public ActionResult DeleteConfirmed(short id) { TRANGTHAIBH tRANGTHAIBH = db.TRANGTHAIBHs.Find(id); db.TRANGTHAIBHs.Remove(tRANGTHAIBH); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TTBH_ID,TTBH_TEN,TTBH_MOTA")] TRANGTHAIBH tRANGTHAIBH) { if (ModelState.IsValid) { db.Entry(tRANGTHAIBH).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tRANGTHAIBH)); }
public ActionResult Create([Bind(Include = "TTBH_ID,TTBH_TEN,TTBH_MOTA")] TRANGTHAIBH tRANGTHAIBH) { if (ModelState.IsValid) { tRANGTHAIBH.TTBH_ID = Convert.ToInt16(db.autottang("TRANGTHAIBH", "TTBH_ID", db.TRANGTHAIBHs.Count())); db.TRANGTHAIBHs.Add(tRANGTHAIBH); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tRANGTHAIBH)); }
// GET: TRANGTHAIBHs/Delete/5 public ActionResult Delete(short?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TRANGTHAIBH tRANGTHAIBH = db.TRANGTHAIBHs.Find(id); if (tRANGTHAIBH == null) { return(HttpNotFound()); } return(View(tRANGTHAIBH)); }