Пример #1
0
        public ActionResult EditGroup(RoleGroupDTO roleGroup)
        {
            if (roleGroup.Id == Guid.Empty)
            {
                _roleGroupService.Add(roleGroup);
            }
            else
            {
                _roleGroupService.Update(roleGroup);
            }

            return(Json(new AjaxResponse
            {
                Succeeded = true,
                ShowMessage = false,
                RedirectUrl = Url.Action("Index")
            }));
        }
        public ActionResult EditGroup(RoleGroupDTO roleGroup)
        {
            return(HttpHandleExtensions.AjaxCallGetResult(() =>
            {
                if (roleGroup.Id == Guid.Empty)
                {
                    _roleGroupService.Add(roleGroup);
                    this.JsMessage = MessagesResources.Add_Success;
                }
                else
                {
                    _roleGroupService.Update(roleGroup);
                    this.JsMessage = MessagesResources.Update_Success;
                }

                return Json(new AjaxResponse
                {
                    Succeeded = true,
                    RedirectUrl = Url.Action("Index")
                });
            }));
        }
Пример #3
0
 public async Task <ActionResult <int> > Add(InsertRoleGroupReq req)
 {
     return(Ok(await _roleGroupService.Add(UserId,
                                           req)));
 }