public ActionResult DeleteConfirmed(int id) { ProductsTbl productsTbl = db.ProductsTbls.Find(id); db.ProductsTbls.Remove(productsTbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Prod_Name,Prod_Rate,Model_Id")] ProductsTbl productsTbl) { if (ModelState.IsValid) { db.Entry(productsTbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Model_Id = new SelectList(db.DetailsTbls, "Model_Id", "Model_Name", productsTbl.Model_Id); return(View(productsTbl)); }
// GET: ProductsTbls/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProductsTbl productsTbl = db.ProductsTbls.Find(id); if (productsTbl == null) { return(HttpNotFound()); } return(View(productsTbl)); }
// GET: ProductsTbls/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProductsTbl productsTbl = db.ProductsTbls.Find(id); if (productsTbl == null) { return(HttpNotFound()); } ViewBag.Model_Id = new SelectList(db.DetailsTbls, "Model_Id", "Model_Name", productsTbl.Model_Id); return(View(productsTbl)); }