コード例 #1
0
 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));
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 public MonthlyReportRule Update(MonthlyReportRule monthlyReportRule)
 {
     _monthlyReportRepository.Update(monthlyReportRule);
     _uow.Commit();
     return(monthlyReportRule);
 }
コード例 #4
0
 public void Add(MonthlyReportRule entity)
 {
     _monthlyReportRepository.Add(entity);
     _uow.Commit();
 }
コード例 #5
0
        public ActionResult AddJournalVoucherRule()
        {
            var model = new MonthlyReportRule();

            return(View(model));
        }