Exemplo n.º 1
0
 public IActionResult Index(AddGiftViewModel addGiftViewModel)
 {
     if (ModelState.IsValid)
     {
         Transactions newTransaction = new Transactions()
         {
             TDonor    = addGiftViewModel.TDonor,
             TYear     = addGiftViewModel.currentYear,
             TMonth    = addGiftViewModel.currentMonth,
             TDay      = addGiftViewModel.currentDay,
             TAmount   = addGiftViewModel.TAmount,
             TCampaign = addGiftViewModel.TCampaign
         };
         context.Transactions.Add(newTransaction);
         context.SaveChanges();
         TempData["message"] = "Gift posted to database";
         return(Redirect("/Gift"));
     }
     return(View());
 }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            AddGiftViewModel addGiftViewModel = new AddGiftViewModel();

            return(View(addGiftViewModel));
        }