/// <summary> /// 永久关闭员工信息并删除及其登录账号 /// </summary> /// <param name="employeeID">员工编号</param> /// <param name="userName">员工(账号)登录名</param> public static void CloseAccount(int employeeID, string userName) { // 在成员表中删除用户 Membership.DeleteUser(userName); // 在员工表中修改状态 Employee employee = DALEmployee.SelectEmployeeByID(employeeID); employee.Status = EmployeeStatusType.Closed; DALEmployee.UpdateEmployee(employee); }
/// <summary> /// 审批(通过)员工,从而使之可以登录 /// </summary> /// <param name="employeeID">待审批的员工编号</param> /// <param name="userName">待审批的员工(账号)登录名</param> public static void ApproveEmployee(int employeeID, string userName) { // 在成员表中审批User MembershipUser user = Membership.GetUser(userName); user.IsApproved = true; Membership.UpdateUser(user); // 在员工表中修改Employee状态 Employee employee = DALEmployee.SelectEmployeeByID(employeeID); employee.Status = EmployeeStatusType.Active; DALEmployee.UpdateEmployee(employee); }