public ActionResult DeleteConfirmed(int id) { EntityMaster entityMaster = db.EntityMasters.Find(id); db.EntityMasters.Remove(entityMaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "EntityID,EntityShort,EntityLegalName,Corporation,Location,Country,Comment,UserID,DateModified,DateAdded")] EntityMaster entityMaster) { if (ModelState.IsValid) { db.Entry(entityMaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Corporation = new SelectList(db.CorporateMasters, "Corporate_ID", "CorporateShort", entityMaster.Corporation); ViewBag.Country = new SelectList(db.CountryLists, "CountryID", "Country", entityMaster.Country); return(View(entityMaster)); }
// GET: EntityMasters/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EntityMaster entityMaster = db.EntityMasters.Find(id); if (entityMaster == null) { return(HttpNotFound()); } return(View(entityMaster)); }
// GET: EntityMasters/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EntityMaster entityMaster = db.EntityMasters.Find(id); if (entityMaster == null) { return(HttpNotFound()); } ViewBag.Corporation = new SelectList(db.CorporateMasters, "Corporate_ID", "CorporateShort", entityMaster.Corporation); ViewBag.Country = new SelectList(db.CountryLists, "CountryID", "Country", entityMaster.Country); return(View(entityMaster)); }