//Search Duplicate Department public ExceptionTypes CheckDuplicateDep(long?TimeZone, DOCMN_Department objDOCMN_Department, out List <DOCMN_Department> lstDOCMN_Department, out string errorMessage) { retValue = new ExceptionTypes(); DALDepartment objDALDepartment = new DALDepartment(); return(retValue = objDALDepartment.CheckDuplicateDep(TimeZone, objDOCMN_Department, out lstDOCMN_Department, out errorMessage)); }
//Search Department by Department ID public ExceptionTypes SearchDepartmentById(long?TimeZone, DOCMN_Department department, out List <DOCMN_Department> lstDOCMN_Department, out string errorMessage) { retValue = new ExceptionTypes(); DALDepartment objDALDepartment = new DALDepartment(); return(retValue = objDALDepartment.SearchDepartmentById(TimeZone, department, out lstDOCMN_Department, out errorMessage)); }
public ExceptionTypes SaveDepartment(DOCMN_Department objDOCMN_Department, out string errorMessage) { retValue = new ExceptionTypes(); DALDepartment objDALDepartment = new DALDepartment(); return(retValue = objDALDepartment.SaveDepartment(objDOCMN_Department, out errorMessage)); }
/// <summary> /// 删除部门信息 /// </summary> /// <param name="departmentID">待删除的部门编号</param> /// <returns>操作结果。如果该部门下仍包含员工,则不可删除并返回StaffOpResult.DependanceExists</returns> public static StaffOpResult DeleteDepartment(int departmentID) { if (DALDepartment.IsEmployeeExists(departmentID)) { return(StaffOpResult.DependanceExists); } else { DALDepartment.DeleteDepartment(departmentID); return(StaffOpResult.Success); } }
/// <summary> /// 更新部门信息 /// </summary> /// <param name="department">待更新的部门对象实例</param> /// <returns>操作结果。如果部门名称已经存在,则返回StaffOpResult.Duplicate</returns> public static StaffOpResult UpdateDepartment(Department department) { if (DALDepartment.IsDepartmentNameExists(department.DepartmentName, department.DepartmentID)) { return(StaffOpResult.Duplicate); } else { DALDepartment.UpdateDepartment(department); return(StaffOpResult.Success); } }
/// <summary> /// 添加新部门 /// </summary> /// <param name="departmentName">部门名称</param> /// <returns>操作结果。如果部门名称已经存在,则返回StaffOpResult.Duplicate</returns> public static StaffOpResult AddDepartment(string departmentName) { if (DALDepartment.IsDepartmentNameExists(departmentName, 0)) { return(StaffOpResult.Duplicate); } else { DALDepartment.InsertDepartment(departmentName); return(StaffOpResult.Success); } }
public List <Department> GetDepartment(int RoleId) { try { DALDepartment dept = new DALDepartment(); return(dept.LoadDepartment(RoleId)); } catch (Exception ex) { throw; } }
/// <summary> /// 获得所有部门信息列表 /// </summary> /// <returns>部门信息集合</returns> public static List <Department> GetAllDepartments() { return(DALDepartment.SelectAllDepartments()); }