Esempio n. 1
0
 /// <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);
     }
 }
Esempio n. 2
0
 /// <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);
     }
 }