public ActionResult DeleteConfirmed(int id) { tblpro tblpro = db.tblproes.Find(id); db.tblproes.Remove(tblpro); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "pid,pname,pprice,pdetails,cid")] tblpro tblpro) { if (ModelState.IsValid) { db.Entry(tblpro).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.cid = new SelectList(db.tblcats, "cid", "cname", tblpro.cid); return(View(tblpro)); }
public ActionResult Create([Bind(Include = "pid,pname,pprice,pdetails,cid")] tblpro tblpro) { if (ModelState.IsValid) { db.tblproes.Add(tblpro); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.cid = new SelectList(db.tblcats, "cid", "cname", tblpro.cid); return(View(tblpro)); }
// GET: Product/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblpro tblpro = db.tblproes.Find(id); if (tblpro == null) { return(HttpNotFound()); } return(View(tblpro)); }
// GET: Product/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblpro tblpro = db.tblproes.Find(id); if (tblpro == null) { return(HttpNotFound()); } ViewBag.cid = new SelectList(db.tblcats, "cid", "cname", tblpro.cid); return(View(tblpro)); }