public ActionResult AddJournalVoucherRule(MonthlyReportRule model) { if (ModelState.IsValid) { _journalVoucherRuleService.Add(model); Success($"<strong>{model.Description}</strong> for <strong>{model.FundIds}</strong> was successfully saved."); return(RedirectToAction("JournalVoucherReport")); } return(View(model)); }
public ActionResult EditJournalVoucherRule(MonthlyReportRule model) { if (ModelState.IsValid) { var result = _journalVoucherRuleService.Get(model.Id); if (result == null) { return(HttpNotFound()); } result.CreditAccount = model.CreditAccount; result.DebitAccount = model.DebitAccount; result.CreditExceptionNegative = string.IsNullOrWhiteSpace(model.CreditExceptionNegative) ? null : model.CreditExceptionNegative; result.DebitExceptionNegative = string.IsNullOrWhiteSpace(model.DebitExceptionNegative) ? null : model.DebitExceptionNegative; result.FundIds = model.FundIds; result = _journalVoucherRuleService.Update(result); if (result == null) { return(HttpNotFound()); } return(RedirectToAction("JournalVoucherReport")); } ModelState.AddModelError("", "An error occurred."); return(View()); }
public MonthlyReportRule Update(MonthlyReportRule monthlyReportRule) { _monthlyReportRepository.Update(monthlyReportRule); _uow.Commit(); return(monthlyReportRule); }
public void Add(MonthlyReportRule entity) { _monthlyReportRepository.Add(entity); _uow.Commit(); }
public ActionResult AddJournalVoucherRule() { var model = new MonthlyReportRule(); return(View(model)); }