Example #1
0
        public IActionResult Save(PermissionDto model)
        {
            UpdateAuditInformation(model);
            if (!ModelState.IsValid)
            {
                GetStateSettings(ViewState.Write);
                return(PartialView("Edit", model));
            }
            model = model.Id > 0
                ? _permissionApiClient.PutPermission(model.Id, model).Result
                : _permissionApiClient.PostPermission(model).Result;

            if (!string.IsNullOrWhiteSpace(model.ErrorMessage))
            {
                return(PartialView("Edit", model));
            }
            return(Json(new { success = string.IsNullOrWhiteSpace(model.ErrorMessage), message = model.SuccessMessage }));
        }
Example #2
0
 public async Task <PermissionDto> PostPermission(PermissionDto model)
 {
     return(await _PermissionApiClient.PostPermission(model));
 }