예제 #1
0
        public ActionResult Create(Supplies supplies)
        {
            if (ModelState.IsValid)
            {
                db.Supplies.Add(supplies);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(supplies);
        }
예제 #2
0
 public ActionResult Edit(Supplies supplies)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supplies).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(supplies);
 }