Exemple #1
0
 public IActionResult Create(Invoice inVM)
 {
     if (ModelState.IsValid)
     {
         InvoiceRepo inVMRepo = new InvoiceRepo(_context);
         var         success  = inVMRepo.Create(inVM);
         if (success)
         {
             return(RedirectToAction(nameof(Index)));
         }
     }
     ViewBag.Error = "An error occurred while creating this invoice. Please try again.";
     return(View());
 }
Exemple #2
0
 public void Add(Invoice t)
 {
     repo.Create(t);
 }