public ActionResult DeleteConfirmed(string id) { LOAIKHACHSAN lOAIKHACHSAN = db.LOAIKHACHSANs.Find(id); db.LOAIKHACHSANs.Remove(lOAIKHACHSAN); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MALOAI_KS,GHICHU")] LOAIKHACHSAN lOAIKHACHSAN) { if (ModelState.IsValid) { db.Entry(lOAIKHACHSAN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lOAIKHACHSAN)); }
public ActionResult Create([Bind(Include = "MALOAI_KS,GHICHU")] LOAIKHACHSAN lOAIKHACHSAN) { if (ModelState.IsValid) { db.LOAIKHACHSANs.Add(lOAIKHACHSAN); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lOAIKHACHSAN)); }
// GET: admin/LOAIKHACHSANs/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LOAIKHACHSAN lOAIKHACHSAN = db.LOAIKHACHSANs.Find(id); if (lOAIKHACHSAN == null) { return(HttpNotFound()); } return(View(lOAIKHACHSAN)); }