public ActionResult DeleteConfirmed(string id) { LastMileType lastMileType = GM.FindBy(x => x.lastMileType == id).FirstOrDefault(); GM.Delete(lastMileType); GM.Save(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "lastMileType")] LastMileType itemlastMileType) { if (ModelState.IsValid) { //db.Entry(itemlastMileType).State = EntityState.Modified; GM.Edit(itemlastMileType); GM.Save(); return(RedirectToAction("Index")); } return(View(itemlastMileType)); }
public ActionResult Create([Bind(Include = "lastMileType")] LastMileType itemlastMileType) { if (ModelState.IsValid) { GM.Add(itemlastMileType); GM.Save(); return(RedirectToAction("Index")); } return(View(itemlastMileType)); }
// GET: LastMileTypes/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LastMileType lastMileType = GM.FindBy(x => x.lastMileType == id).FirstOrDefault(); if (lastMileType == null) { return(HttpNotFound()); } return(View(lastMileType)); }