public ActionResult Edit([Bind(Include = "contractTypeid,contract_Type_code,contract_type_name,contract_type_description")] contract_type contract_type) { if (ModelState.IsValid) { db.Entry(contract_type).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contract_type)); }
public ActionResult Create([Bind(Include = "contractTypeid,contract_Type_code,contract_type_name,contract_type_description")] contract_type contract_type) { if (ModelState.IsValid) { db.contract_type.Add(contract_type); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contract_type)); }
// GET: /contracttype/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } contract_type contract_type = db.contract_type.Find(id); if (contract_type == null) { return(HttpNotFound()); } return(View(contract_type)); }
public ActionResult DeleteConfirmed(int id) { try { contract_type contract_type = db.contract_type.Find(id); db.contract_type.Remove(contract_type); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View(ex)); } }