public ActionResult DeleteConfirmed(int id) { StateTbl stateTbl = db.StateTbls.Find(id); db.StateTbls.Remove(stateTbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,CountryId,IsActive")] StateTbl stateTbl) { if (ModelState.IsValid) { db.Entry(stateTbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CountryId = new SelectList(db.CountryTbls, "Id", "Name", stateTbl.CountryId); return(View(stateTbl)); }
// GET: Admin/StateTbls/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StateTbl stateTbl = db.StateTbls.Find(id); if (stateTbl == null) { return(HttpNotFound()); } return(View(stateTbl)); }
// GET: Admin/StateTbls/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StateTbl stateTbl = db.StateTbls.Find(id); if (stateTbl == null) { return(HttpNotFound()); } ViewBag.CountryId = new SelectList(db.CountryTbls, "Id", "Name", stateTbl.CountryId); return(View(stateTbl)); }