public ActionResult DeleteConfirmed(int id) { Suply_tbl suply_tbl = db.suply_Tbls.Find(id); db.suply_Tbls.Remove(suply_tbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Phone,Address,GovernorateId")] Suply_tbl suply_tbl) { if (ModelState.IsValid) { db.Entry(suply_tbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GovernorateId = new SelectList(db.Governorates, "Id", "Gov_Name", suply_tbl.GovernorateId); return(View(suply_tbl)); }
public ActionResult Create([Bind(Include = "Id,Name,Phone,Address,GovernorateId")] Suply_tbl suply_tbl) { if (ModelState.IsValid) { db.suply_Tbls.Add(suply_tbl); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GovernorateId = new SelectList(db.Governorates, "Id", "Gov_Name", suply_tbl.GovernorateId); return(View(suply_tbl)); }
// GET: Suply_tbl/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Suply_tbl suply_tbl = db.suply_Tbls.Find(id); if (suply_tbl == null) { return(HttpNotFound()); } return(View(suply_tbl)); }
// GET: Suply_tbl/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Suply_tbl suply_tbl = db.suply_Tbls.Find(id); if (suply_tbl == null) { return(HttpNotFound()); } ViewBag.GovernorateId = new SelectList(db.Governorates, "Id", "Gov_Name", suply_tbl.GovernorateId); return(View(suply_tbl)); }