예제 #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     FashionGo.Models.Entities.TransportType transportType = db.TransportTypes.Find(id);
     db.TransportTypes.Remove(transportType);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Description")] FashionGo.Models.Entities.TransportType transportType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(transportType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(transportType));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Description")] FashionGo.Models.Entities.TransportType transportType)
        {
            if (ModelState.IsValid)
            {
                db.TransportTypes.Add(transportType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(transportType));
        }
예제 #4
0
 // GET: Admin/TransportTypes/Delete/5
 public ActionResult Delete(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     FashionGo.Models.Entities.TransportType transportType = db.TransportTypes.Find(id);
     if (transportType == null)
     {
         return(HttpNotFound());
     }
     return(View(transportType));
 }