// // GET: /Transaction/Create public ActionResult Create() { var model = new Transaction(); model.Timestamp = DateTime.Now; PopulateStoreDropdown(); return View(model); }
public ActionResult Create(Transaction transaction) { if (ModelState.IsValid) { db.Transactions.Add(transaction); db.SaveChanges(); return RedirectToAction("Index"); } return View(transaction); }