示例#1
0
 /// <summary>
 /// Cập nhật quyền truy cập menu cho quyền
 /// </summary>
 /// <param name="model"></param>
 /// <param name="userName"></param>
 /// <returns></returns>
 public object UpdateRoleInMenu(RoleMenuUpdateModel model, string userName)
 {
     try
     {
         string _lstMenu = string.Empty;
         if (model.LstMenuID != null && model.LstMenuID.Count > 0)
         {
             model.LstMenuID.ForEach(x =>
             {
                 _lstMenu += !string.IsNullOrEmpty(_lstMenu) ? ("," + x) : x;
             });
         }
         SqlParameter[] param = new SqlParameter[4];
         param[0] = new SqlParameter("@RoleID", model.RoleID);
         param[1] = new SqlParameter("@MenuParentID", model.MenuParentID);
         param[2] = new SqlParameter("@LstMenuID", _lstMenu);
         param[3] = new SqlParameter("@userName", userName);
         SqlHelper.ExecuteDataTable(SqlHelper.ConnectionString, CommandType.StoredProcedure, "dbo.MNG_UpdateRoleInMenu", param);
         return(MP_AjaxError.OK);
     }
     catch (System.Exception ex)
     {
         return(ex);
     }
 }
示例#2
0
        public async Task <IResultModel> Update(RoleMenuUpdateModel model)
        {
            var entity = await _repository.FirstAsync(model.Id);

            if (entity == null)
            {
                return(ResultModel.NotExists);
            }

            _mapper.Map(model, entity);

            var result = await _repository.UpdateAsync(entity);

            return(ResultModel.Result(result));
        }
示例#3
0
 public Task <IResultModel> Update(RoleMenuUpdateModel model)
 {
     return(_service.Update(model));
 }
示例#4
0
 public HttpResponseMessage UpdateRoleInMenu(RoleMenuUpdateModel objs)
 {
     return(Request.CreateResponse(HttpStatusCode.OK,
                                   new { value = _roleServices.UpdateRoleInMenu(objs, this.RequestContext.Principal.Identity.Name) }));
 }