public ActionResult DeleteXP(int id) { tbl_Ward tbl_Ward = db.tbl_Ward.Find(id); db.tbl_Ward.Remove(tbl_Ward); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_Ward,Ward_Name,ID_District,CreateBy,UpdateBy,CreateDate,UpdateDate,Status")] tbl_Ward tbl_Ward) { if (ModelState.IsValid) { tbl_Ward.UpdateDate = DateTime.Now; db.Entry(tbl_Ward).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_District = new SelectList(db.tbl_District, "ID_District", "District_Name", tbl_Ward.ID_District); return(View(tbl_Ward)); }
// GET: Admin/tbl_Wards/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Ward tbl_Ward = db.tbl_Ward.Find(id); if (tbl_Ward == null) { return(HttpNotFound()); } return(View(tbl_Ward)); }
// GET: Admin/tbl_Wards/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Ward tbl_Ward = db.tbl_Ward.Find(id); if (tbl_Ward == null) { return(HttpNotFound()); } ViewBag.ID_District = new SelectList(db.tbl_District, "ID_District", "District_Name", tbl_Ward.ID_District); return(View(tbl_Ward)); }