public ActionResult DeleteConfirmed(string id) { Gen_Mst_Table gen_Mst_Table = db.Gen_Mst_Table.FirstOrDefault(m => m.TableName == id); db.Gen_Mst_Table.Remove(gen_Mst_Table); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ProductCode,TableCode,TableName,Comments,TableOrder,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate")] Gen_Mst_Table gen_Mst_Table) { if (ModelState.IsValid) { db.Entry(gen_Mst_Table).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProductCode = new SelectList(db.Gen_Mst_Product, "ProductCode", "ProductName", gen_Mst_Table.ProductCode); return(View(gen_Mst_Table)); }
// GET: Table/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Gen_Mst_Table gen_Mst_Table = db.Gen_Mst_Table.FirstOrDefault(m => m.TableOrder == id); if (gen_Mst_Table == null) { return(HttpNotFound()); } return(View(gen_Mst_Table)); }
// GET: Table/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Gen_Mst_Table gen_Mst_Table = db.Gen_Mst_Table.FirstOrDefault(m => m.TableOrder == id); if (gen_Mst_Table == null) { return(HttpNotFound()); } ViewBag.ProductCode = new SelectList(db.Gen_Mst_Product, "ProductCode", "ProductName", gen_Mst_Table.ProductCode); return(View(gen_Mst_Table)); }