public IActionResult SaveChequePartial(Cheques model)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(PartialView("AddEditChequePartial", model));
         }
         if (model?.Id == null)
         {
             chequeService.Insert(model);
         }
         else
         {
             chequeService.Update(model);
         }
     }
     catch (Exception e)
     {
         PartialView("AddEditChequePartial", model);
     }
     ViewData["isSuccess"] = true;
     return(Json(new { isSuccess = true }));
 }
Beispiel #2
0
 public async Task <IActionResult> Update([FromBody] ChequeUpdateDto dto, int id)
 => await GetResponse(async (userId) =>
                      new ApiResponseViewModel(true, "Cheque Updated Successfully", await _service.Update(dto, id, userId)));