Exemple #1
0
        public async Task <IActionResult> CreateUpdate(InsuranceCRUDViewModel model)
        {
            try
            {
                await _insuranceService.CreateUpdateInsuranceAsync(model);

                var message = model.Id != null ? Messages.ItemUpdatedSuccessFully : Messages.ItemAddedSuccessFully;

                return(Json(new { success = true, message }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }));
            }
        }