예제 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            LastMileType lastMileType = GM.FindBy(x => x.lastMileType == id).FirstOrDefault();

            GM.Delete(lastMileType);
            GM.Save();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "lastMileType")] LastMileType itemlastMileType)
        {
            if (ModelState.IsValid)
            {
                GM.Add(itemlastMileType);
                GM.Save();
                return(RedirectToAction("Index"));
            }

            return(View(itemlastMileType));
        }
예제 #4
0
        // 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));
        }