Example #1
0
        //
        // GET: /Transaction/Create
        public ActionResult Create()
        {
            var model = new Transaction();
            model.Timestamp = DateTime.Now;

            PopulateStoreDropdown();
            return View(model);
        }
Example #2
0
        public ActionResult Create(Transaction transaction)
        {
            if (ModelState.IsValid)
            {
                db.Transactions.Add(transaction);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(transaction);
        }