/// <summary> /// 删除用户(批量删除) /// </summary> /// <param name="roleId"></param> /// <returns></returns> public HandleResult <bool> DelRole(IEnumerable <string> roleId) { var handleResult = new HandleResult <bool>(); //查出需要删除的角色 var sysRoles = sysRoleDAL.GetModels(t => roleId.Any(a => a.Equals(t.RoleId))); foreach (var item in sysRoles) { //逻辑删除角色 item.DeleteSign = (int)DeleteSign.Sign_Undeleted; item.DeleteTime = DateTime.Now; sysRoleDAL.Update(item); } //最后一起提交数据库 bool bResult = sysRoleDAL.SaveChanges(); handleResult.Result = bResult; handleResult.Msg = bResult ? "删除成功" : "删除失败"; return(handleResult); }
public void Update(SysRole sysRole) { sysRoleDal.Update(sysRole); }