Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AmountOfMaterial amountofmaterial = db.AmountOfMaterials.Find(id);

            db.AmountOfMaterials.Remove(amountofmaterial);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        //
        // GET: /AmountOfMaterial/Details/5

        public ActionResult Details(int id = 0)
        {
            AmountOfMaterial amountofmaterial = db.AmountOfMaterials.Find(id);

            if (amountofmaterial == null)
            {
                return(HttpNotFound());
            }
            return(View(amountofmaterial));
        }
Exemple #3
0
 public ActionResult Edit(AmountOfMaterial amountofmaterial)
 {
     if (ModelState.IsValid)
     {
         db.Entry(amountofmaterial).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RawMaterialsId   = new SelectList(db.RawMaterials, "Id", "Nume", amountofmaterial.RawMaterialsId);
     ViewBag.StockMaterialsId = new SelectList(db.StockMaterials, "Id", "Id", amountofmaterial.StockMaterialsId);
     return(View(amountofmaterial));
 }
Exemple #4
0
        //
        // GET: /AmountOfMaterial/Edit/5

        public ActionResult Edit(int id = 0)
        {
            AmountOfMaterial amountofmaterial = db.AmountOfMaterials.Find(id);

            if (amountofmaterial == null)
            {
                return(HttpNotFound());
            }
            ViewBag.RawMaterialsId   = new SelectList(db.RawMaterials, "Id", "Nume", amountofmaterial.RawMaterialsId);
            ViewBag.StockMaterialsId = new SelectList(db.StockMaterials, "Id", "Id", amountofmaterial.StockMaterialsId);
            return(View(amountofmaterial));
        }
Exemple #5
0
        public ActionResult Create(AmountOfMaterial amountofmaterial)
        {
            if (ModelState.IsValid)
            {
                db.AmountOfMaterials.Add(amountofmaterial);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.RawMaterialsId   = new SelectList(db.RawMaterials, "Id", "Nume", amountofmaterial.RawMaterialsId);
            ViewBag.StockMaterialsId = new SelectList(db.StockMaterials, "Id", "Id", amountofmaterial.StockMaterialsId);
            return(View(amountofmaterial));
        }