public dynamic Update(CashBankMutation model) { try { var data = _cashBankMutationService.GetObjectById(model.Id); data.SourceCashBankId = model.SourceCashBankId; data.TargetCashBankId = model.TargetCashBankId; data.Amount = model.Amount; model = _cashBankMutationService.UpdateObject(data, _cashBankService); } catch (Exception ex) { LOG.Error("Update Failed", ex); } return(Json(new { model.Errors })); }
public dynamic Update(CashBankMutation model) { try { if (!AuthenticationModel.IsAllowed("Edit", Core.Constants.Constant.MenuName.CashBankMutation, Core.Constants.Constant.MenuGroupName.Master)) { Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "You are Not Allowed to Edit record"); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } var data = _cashBankMutationService.GetObjectById(model.Id); data.SourceCashBankId = model.SourceCashBankId; data.TargetCashBankId = model.TargetCashBankId; data.Amount = model.Amount; model = _cashBankMutationService.UpdateObject(data, _cashBankService); } catch (Exception ex) { LOG.Error("Update Failed", ex); Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "Error " + ex); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } return(Json(new { model.Errors })); }