public ActionResult DeleteConfirmed(int id) { TrungTamGanNhat trungTamGanNhat = db.TrungTamGanNhats.Find(id); db.TrungTamGanNhats.Remove(trungTamGanNhat); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IDTrungTam,TenTrungTam,Mota,IDTinh")] TrungTamGanNhat trungTamGanNhat) { if (ModelState.IsValid) { db.Entry(trungTamGanNhat).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IDTinh = new SelectList(db.TinhThanhs, "IDTinh", "TenTinh", trungTamGanNhat.IDTinh); return(View(trungTamGanNhat)); }
public ActionResult Create([Bind(Include = "IDTrungTam,TenTrungTam,Mota,IDTinh")] TrungTamGanNhat trungTamGanNhat) { if (ModelState.IsValid) { db.TrungTamGanNhats.Add(trungTamGanNhat); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IDTinh = new SelectList(db.TinhThanhs, "IDTinh", "TenTinh", trungTamGanNhat.IDTinh); return(View(trungTamGanNhat)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.NotFound)); } TrungTamGanNhat tt = db.TrungTamGanNhats.Find(id); if (tt == null) { return(HttpNotFound()); } return(View(tt)); }
// GET: Admin/TrungTamGanNhats/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TrungTamGanNhat trungTamGanNhat = db.TrungTamGanNhats.Find(id); if (trungTamGanNhat == null) { return(HttpNotFound()); } return(View(trungTamGanNhat)); }
// GET: Admin/TrungTamGanNhats/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TrungTamGanNhat trungTamGanNhat = db.TrungTamGanNhats.Find(id); if (trungTamGanNhat == null) { return(HttpNotFound()); } ViewBag.IDTinh = new SelectList(db.TinhThanhs, "IDTinh", "TenTinh", trungTamGanNhat.IDTinh); return(View(trungTamGanNhat)); }