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