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