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