Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Dairy dairy = db.Dairy.Find(id);

            db.Dairy.Remove(dairy);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "dairyID,dName,dAddress,dCity,StateID,dZip,dPhone")] Dairy dairy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dairy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StateID = new SelectList(db.State, "StateID", "StateName", dairy.StateID);
     return(View(dairy));
 }
Ejemplo n.º 3
0
        // GET: Dairies/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Dairy dairy = db.Dairy.Find(id);

            if (dairy == null)
            {
                return(HttpNotFound());
            }
            return(View(dairy));
        }
Ejemplo n.º 4
0
        // GET: Dairies/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Dairy dairy = db.Dairy.Find(id);

            if (dairy == null)
            {
                return(HttpNotFound());
            }
            ViewBag.StateID = new SelectList(db.State, "StateID", "StateName", dairy.StateID);
            return(View(dairy));
        }