コード例 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            NguyenLieu_MonAn nguyenLieu_MonAn = db.NguyenLieu_MonAn.Find(id);

            db.NguyenLieu_MonAn.Remove(nguyenLieu_MonAn);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "MaMonAn,MaNguyenLieu,SoLuong")] NguyenLieu_MonAn nguyenLieu_MonAn)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nguyenLieu_MonAn).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaMonAn      = new SelectList(db.MonAns, "MaMonAn", "TenMonAn", nguyenLieu_MonAn.MaMonAn);
     ViewBag.MaNguyenLieu = new SelectList(db.NguyenLieux, "MaNguyenLieu", "TenNguyenLieu", nguyenLieu_MonAn.MaNguyenLieu);
     return(View(nguyenLieu_MonAn));
 }
コード例 #3
0
        // GET: NguyenLieu_MonAn/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NguyenLieu_MonAn nguyenLieu_MonAn = db.NguyenLieu_MonAn.Find(id);

            if (nguyenLieu_MonAn == null)
            {
                return(HttpNotFound());
            }
            return(View(nguyenLieu_MonAn));
        }
コード例 #4
0
        // GET: NguyenLieu_MonAn/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NguyenLieu_MonAn nguyenLieu_MonAn = db.NguyenLieu_MonAn.Find(id);

            if (nguyenLieu_MonAn == null)
            {
                return(HttpNotFound());
            }
            ViewBag.MaMonAn      = new SelectList(db.MonAns, "MaMonAn", "TenMonAn", nguyenLieu_MonAn.MaMonAn);
            ViewBag.MaNguyenLieu = new SelectList(db.NguyenLieux, "MaNguyenLieu", "TenNguyenLieu", nguyenLieu_MonAn.MaNguyenLieu);
            return(View(nguyenLieu_MonAn));
        }