示例#1
0
        /// <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);
        }
示例#2
0
 /// <summary>
 /// 更新角色状态
 /// </summary>
 /// <param name="entity">角色信息</param>
 public static void UpdateRolesStatusBySysNo(Roles entity)
 {
     DataCommand cmd = DataCommandManager.GetDataCommand("UpdateRolesStatusBySysNo");
     cmd.SetParameterValue<Roles>(entity);
     cmd.ExecuteNonQuery();
 }
示例#3
0
 /// <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"));
 }