예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MakeToner makeToner = db.MakeToners.Find(id);

            db.MakeToners.Remove(makeToner);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "MakeTonerID,MakeTonerDate,MakeTonerQuantity,MakeTonerPrice,Remark,TonerID,OwnerID")] MakeToner makeToner)
 {
     if (ModelState.IsValid)
     {
         db.Entry(makeToner).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OwnerID = new SelectList(db.Owners, "OwnerID", "OwnerName", makeToner.OwnerID);
     ViewBag.TonerID = new SelectList(db.Toners, "TonerID", "TonerModel", makeToner.TonerID);
     return(View(makeToner));
 }
예제 #3
0
        // GET: MakeToners/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MakeToner makeToner = db.MakeToners.Find(id);

            if (makeToner == null)
            {
                return(HttpNotFound());
            }
            return(View(makeToner));
        }
예제 #4
0
        // GET: MakeToners/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MakeToner makeToner = db.MakeToners.Find(id);

            if (makeToner == null)
            {
                return(HttpNotFound());
            }
            ViewBag.OwnerID = new SelectList(db.Owners, "OwnerID", "OwnerName", makeToner.OwnerID);
            ViewBag.TonerID = new SelectList(db.Toners, "TonerID", "TonerModel", makeToner.TonerID);
            return(View(makeToner));
        }