public ActionResult DeleteConfirmed(Guid id) { KHOI_LOP kHOI_LOP = db.KHOI_LOP.Find(id); db.KHOI_LOP.Remove(kHOI_LOP); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MA_KHOI,TEN_KHOI")] KHOI_LOP kHOI_LOP) { if (ModelState.IsValid) { db.Entry(kHOI_LOP).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(kHOI_LOP)); }
public ActionResult Create(FormCollection f) { if (ModelState.IsValid) { KHOI_LOP kl = new KHOI_LOP(); kl.MA_KHOI = Guid.NewGuid(); kl.TEN_KHOI = f["tenkhoi"]; db.KHOI_LOP.Add(kl); db.SaveChanges(); return(RedirectToAction("Index", "KHOI_LOP", new { area = "Admin" })); } return(View()); }
// GET: Admin/KHOI_LOP/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } KHOI_LOP kHOI_LOP = db.KHOI_LOP.Find(id); if (kHOI_LOP == null) { return(HttpNotFound()); } return(View(kHOI_LOP)); }