Example #1
0
        public ActionResult Create(StockType stocktype)
        {
            if (ModelState.IsValid)
            {
                db.StockTypes.Add(stocktype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(stocktype);
        }
Example #2
0
 public ActionResult Edit(StockType stocktype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stocktype).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(stocktype);
 }