public ActionResult Delete(Int32 id) { tbl_country tb = db.tbl_countries.Where(x => x.country_id == id).Single <tbl_country>(); db.tbl_countries.DeleteOnSubmit(tb); db.SubmitChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Model_country obj) { tbl_country tb = db.tbl_countries.Where(x => x.country_id == obj.country_id).Single <tbl_country>(); tb.country_name = obj.country_name; tb.country_id = obj.country_id; db.SubmitChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(Model_country obj) { tbl_country tb = new tbl_country(); tb.country_name = obj.country_name; db.tbl_countries.InsertOnSubmit(tb); db.SubmitChanges(); return(RedirectToAction("Index")); }