Esempio n. 1
0
        public ActionResult Create(Purchase_Table purchase_table)
        {
            if (ModelState.IsValid)
            {
                db.Purchase_Table.Add(purchase_table);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.Item_ID = new SelectList(db.Item_table, "ID", "Description", purchase_table.Item_ID);
            return View(purchase_table);
        }
Esempio n. 2
0
 public ActionResult Edit(Purchase_Table purchase_table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(purchase_table).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.Item_ID = new SelectList(db.Item_table, "ID", "Description", purchase_table.Item_ID);
     return View(purchase_table);
 }