public ActionResult DeleteConfirmed(int id) { Accessories_Details accessories_Details = db.Accessories_Details.Find(id); db.Accessories_Details.Remove(accessories_Details); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Pets_Id,Accessories_Name,Accessories_Quantity,Accessories_Price,Accessories_Description,Accessories_ImagePath,Accessories_ImageName")] Accessories_Details accessories_Details) { if (ModelState.IsValid) { db.Entry(accessories_Details).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Pets_Id = new SelectList(db.Pet_Details, "Id", "Pet_Category", accessories_Details.Pets_Id); return(View(accessories_Details)); }
// GET: Accessories/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Accessories_Details accessories_Details = db.Accessories_Details.Find(id); if (accessories_Details == null) { return(HttpNotFound()); } return(View(accessories_Details)); }
// GET: Accessories/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Accessories_Details accessories_Details = db.Accessories_Details.Find(id); if (accessories_Details == null) { return(HttpNotFound()); } ViewBag.Pets_Id = new SelectList(db.Pet_Details, "Id", "Pet_Category", accessories_Details.Pets_Id); return(View(accessories_Details)); }