Пример #1
0
        public ActionResult Create(Production production)
        {
            if (ModelState.IsValid)
            {
                db.Productions.Add(production);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.Production_PieceId = new SelectList(db.Pieces, "Piece_Id", "Piece_Name", production.Production_PieceId);
            return View(production);
        }
Пример #2
0
 public ActionResult Edit(Production production)
 {
     if (ModelState.IsValid)
     {
         db.Entry(production).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.Production_PieceId = new SelectList(db.Pieces, "Piece_Id", "Piece_Name", production.Production_PieceId);
     return View(production);
 }