public async Task <IActionResult> OnPostSave([FromBody] SaveOrgPositionCommand command) { try { List <SearchedOrgPositionModel> dbResult = new List <SearchedOrgPositionModel>(); dbResult = await Mediator.Send(command); return(new JsonResult(new UIResult() { Data = new { list = dbResult }, Status = UIStatus.Success, Text = "معلومات موفقانه ثبت سیستم شد", Description = string.Empty })); } catch (Exception ex) { return(new JsonResult(new UIResult() { Data = null, Status = UIStatus.Failure, Text = CustomMessages.StateExceptionTitle(ex), Description = CustomMessages.DescribeException(ex) })); } }
public async Task <IActionResult> OnPostRemove([FromBody] DeletePositionCommand command) { try { List <SearchedPosition> theParentOfDeletedPosition = new List <SearchedPosition>(); theParentOfDeletedPosition = await Mediator.Send(command); return(new JsonResult(new UIResult() { Data = new { list = theParentOfDeletedPosition }, Status = UIStatus.Success, Text = "بست انتخاب شده موفقانه حذف گردید", Description = string.Empty })); } catch (Exception ex) { return(new JsonResult(new UIResult() { Data = new { }, Status = UIStatus.Failure, Text = CustomMessages.StateExceptionTitle(ex), Description = CustomMessages.DescribeException(ex) })); } }
public async Task <IActionResult> OnPostSave([FromBody] SavePersonPublicationCommand command) { try { command.CreatedBy = 10; command.ModifiedBy = "Test"; command.CreatedOn = DateTime.Now; command.ModifiedOn = DateTime.Now; List <SearchedPersonPublication> result = new List <SearchedPersonPublication>(); result = await Mediator.Send(command); return(new JsonResult(new UIResult() { Data = new { list = result }, Status = UIStatus.Success, Text = "انتشار کارمند موفقانه ثبت سیستم شد", Description = string.Empty })); } catch (Exception ex) { return(new JsonResult(new UIResult() { Data = null, Status = UIStatus.Failure, Text = CustomMessages.StateExceptionTitle(ex), Description = CustomMessages.DescribeException(ex) })); } }
public async Task <IActionResult> OnPostSave([FromBody] SavePersonAddressCommand command) { try { command.CreatedBy = 10; // UNTILL : applicatio nof identity command.CreatedOn = DateTime.Now; command.ModifiedBy = "Test"; command.ModifiedOn = DateTime.Now; List <SearchedPersonAdress> dbResult = new List <SearchedPersonAdress>(); dbResult = await Mediator.Send(command); return(new JsonResult(new UIResult() { Data = new { list = dbResult }, Status = UIStatus.Success, Text = "آدرس فرد موفقانه ثبت سیستم گردید", Description = string.Empty })); } catch (Exception ex) { return(new JsonResult(new UIResult() { Data = null, Status = UIStatus.Failure, Text = CustomMessages.StateExceptionTitle(ex), Description = CustomMessages.DescribeException(ex) })); } }