コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            RawMaterialStock rawMaterialStock = db.RawMaterialStocks.Find(id);

            db.RawMaterialStocks.Remove(rawMaterialStock);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,Quantity,RawMaterialID,SectorID")] RawMaterialStock rawMaterialStock)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rawMaterialStock).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RawMaterialID = new SelectList(db.RawMaterials, "ID", "Description", rawMaterialStock.RawMaterialID);
     ViewBag.SectorID      = new SelectList(db.Sectors, "ID", "Name", rawMaterialStock.SectorID);
     return(View(rawMaterialStock));
 }
コード例 #3
0
        // GET: RawMaterialStocks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RawMaterialStock rawMaterialStock = db.RawMaterialStocks.Find(id);

            if (rawMaterialStock == null)
            {
                return(HttpNotFound());
            }
            return(View(rawMaterialStock));
        }
コード例 #4
0
        // GET: RawMaterialStocks/SubmitOrder
        public ActionResult SubmitOrder(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RawMaterialStock rawMaterialStock = db.RawMaterialStocks.Find(id);

            if (rawMaterialStock == null)
            {
                return(HttpNotFound());
            }
            ViewBag.RawMaterialID = new SelectList(db.RawMaterials, "ID", "Description", rawMaterialStock.RawMaterialID);
            return(View(rawMaterialStock));
        }