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