public ActionResult DeleteConfirmed(int id) { Block_HQ block_HQ = db.Block_HQ.Find(id); db.Block_HQ.Remove(block_HQ); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name")] Block_HQ block_HQ) { if (ModelState.IsValid) { db.Entry(block_HQ).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(block_HQ)); }
public ActionResult Create([Bind(Include = "id,name")] Block_HQ block_HQ) { if (ModelState.IsValid) { db.Block_HQ.Add(block_HQ); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(block_HQ)); }
// GET: BlockHQ/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Block_HQ block_HQ = db.Block_HQ.Find(id); if (block_HQ == null) { return(HttpNotFound()); } return(View(block_HQ)); }