/// <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); } }
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)); }
public Task <IResultModel> Update(RoleMenuUpdateModel model) { return(_service.Update(model)); }
public HttpResponseMessage UpdateRoleInMenu(RoleMenuUpdateModel objs) { return(Request.CreateResponse(HttpStatusCode.OK, new { value = _roleServices.UpdateRoleInMenu(objs, this.RequestContext.Principal.Identity.Name) })); }