Ejemplo n.º 1
0
 public ActionResult RoleMenuUpdate(RoleMenuEntryModel model)
 {
     try
     {
         this._roleService.RoleMenuUpdate(model);
         return(this.JsonResultSuccess());
     }
     catch (Exception ex)
     {
         return(this.JsonResultError(ex));
     }
 }
Ejemplo n.º 2
0
        public void RoleMenuUpdate(RoleMenuEntryModel model)
        {
            this._memoryCacheManager.RemoveStartWith(MemoryCacheKey.CURRENT_USER_ROLE_MENU);
            var rm = this._repoRoleMenu.Find(model.id);

            rm.description  = model.description;
            rm.displayOrder = model.displayOrder;
            rm.sourceMenuId = model.menuId;
            rm.updatedBy    = this.GetCurrentUserId();
            rm.updatedDate  = DateTime.Now;
            this._repoRoleMenu.Update(rm);
            this._unitOfWork.Save();
        }
Ejemplo n.º 3
0
 public ActionResult RoleMenuAdd(RoleMenuEntryModel model)
 {
     try
     {
         this._roleService.RoleMenuAdd(model);
         var data = this._roleService.RoleMenuGetById(model.id);
         return(this.JsonResultSuccess(new { data }));
     }
     catch (Exception ex)
     {
         return(this.JsonResultError(ex));
     }
 }
Ejemplo n.º 4
0
        public void RoleMenuAdd(RoleMenuEntryModel model)
        {
            this._memoryCacheManager.RemoveStartWith(MemoryCacheKey.CURRENT_USER_ROLE_MENU);
            var  menu   = this._repoMenu.Find(model.menuId);
            Guid userId = this.GetCurrentUserId();
            var  ins    = this._repoRoleMenu.Insert(new sys_RoleMenu()
            {
                roleId           = model.roleId,
                sourceMenuId     = model.menuId,
                description      = model.description,
                parentRoleMenuId = model.parentMenuId,
                displayOrder     = model.displayOrder,
                updatedBy        = userId,
            });

            this._unitOfWork.Save();
            model.id = ins.id;
        }