- using System;
- using System.Data;
- using qminoa.Common.Data;
- using qminoa.DA;
- namespace qminoa.BLL
- {
- public class DepSystem
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="braID"></param>
- /// <param name="branchName"></param>
- /// <param name="simpleCode"></param>
- /// <returns></returns>
- public bool InsertMrBranch(string branchName,string simpleCode)
- {
- bool result;
- using(MrDep DepAccess = new MrDep())
- {
- result = DepAccess.InsertMrBranch(branchName,simpleCode);
- }
- return result;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="braID"></param>
- /// <param name="branchName"></param>
- /// <param name="simpleCode"></param>
- /// <returns></returns>
- public bool UpdateMrBranch(int braID,string branchName,string simpleCode)
- {
- bool result;
- using(MrDep DepAccess = new MrDep())
- {
- result = DepAccess.UpdateMrBranch(braID,branchName,simpleCode);
- }
- return result;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="braID"></param>
- /// <returns></returns>
- public bool DeleteMrBranch(int braID)
- {
- bool result;
- using(MrDep DepAccess = new MrDep())
- {
- result = DepAccess.DeleteMrBranch(braID);
- }
- return result;
- }
- /// <summary>
- /// 建立一个新的部门
- /// </summary>
- /// <param name="depData"></param>
- /// <returns></returns>
- public bool CreateDep(DepData depData)
- {
- bool result ;
- using(MrDep depAccess = new MrDep())
- {
- result = depAccess.InsertMrDep(depData);
- }
- return result;
- }
- /// <summary>
- /// 更新指定部门信息
- /// </summary>
- /// <param name="depData"></param>
- /// <returns></returns>
- public bool UpdateDep(DepData depData)
- {
- bool result ;
- using(MrDep DepAccess = new MrDep())
- {
- result = DepAccess.UpdateMrDep(depData);
- }
- return result;
- }
- /// <summary>
- /// 获得所有机构信息
- /// </summary>
- /// <returns></returns>
- public DataTable GetBraTB()
- {
- DataTable table ;
- using(MrDep BraAccess = new MrDep())
- {
- table = BraAccess.GetBraData().Tables[0];
- }
- return table;
- }
- /// <summary>
- /// 获得所有部门信息
- /// </summary>
- /// <returns></returns>
- public DataTable GetDepTB()
- {
- DataTable table;
- using(MrDep DepAccess = new MrDep())
- {
- table = DepAccess.GetDepData().Tables[0];
- }
- return table;
- }
- /// <summary>
- /// 获得指定的部门的信息
- /// </summary>
- /// <param name="depID"></param>
- public DataTable GetDepTB_By_DepID(int depID)
- {
- DataTable table ;
- using (MrDep DepAccess = new MrDep())
- {
- table = DepAccess.GetDepData_By_DepID(depID).Tables[0];
- }
- return table;
- }
- /// <summary>
- /// 获取属于指定机构的部门的信息
- /// </summary>
- /// <param name="branchID"></param>
- /// <returns></returns>
- public DataTable GetDepTB_By_BranchID(int branchID)
- {
- DataTable table ;
- using(MrDep DepAccess = new MrDep())
- {
- table = DepAccess.GetDepData_By_BranchID(branchID).Tables[0];
- }
- return table;
- }
- /// <summary>
- /// 删除指定的部门
- /// </summary>
- /// <param name="depID"></param>
- public bool DeleteDep(int depID)
- {
- bool result;
- using(MrDep DepAccess = new MrDep())
- {
- result = DepAccess.DeleteMrDep(depID);
- }
- return result;
- }
- public DepSystem()
- {
- }
- }
- }