/// <summary> /// 删除角色 /// </summary> /// <returns></returns> public ActionResult DeleteRole() { var request = GetParams<List<string>>(); if (request != null && request.Count > 0) { foreach (string str in request) { Roles entity = new Roles() { SysNo = int.Parse(str), Status = Entity.Enums.CommonStatus.Deleted }; this.SetEntityBase(entity, false); RolesMgtService.Instance.UpdateRolesStatusBySysNo(entity); } } PortalResult result = new PortalResult() { Code = 0, Success = true, Data = true, Message = "" }; return View(result); }
/// <summary> /// 更新角色状态 /// </summary> /// <param name="entity">角色信息</param> public static void UpdateRolesStatusBySysNo(Roles entity) { DataCommand cmd = DataCommandManager.GetDataCommand("UpdateRolesStatusBySysNo"); cmd.SetParameterValue<Roles>(entity); cmd.ExecuteNonQuery(); }
/// <summary> /// 添加角色 /// </summary> /// <param name="entity">角色信息</param> /// <returns></returns> public static int InsertRoles(Roles entity) { DataCommand cmd = DataCommandManager.GetDataCommand("InsertRoles"); cmd.SetParameterValue<Roles>(entity); cmd.ExecuteNonQuery(); return Convert.ToInt32(cmd.GetParameterValue("@SysNo")); }