public ActionResult DeleteConfirmed(int id) { Freight_Lookup freight_lookup = db.Freight_Lookup.Find(id); db.Freight_Lookup.Remove(freight_lookup); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Freight_Lookup/Details/5 public ActionResult Details(int id = 0) { Freight_Lookup freight_lookup = db.Freight_Lookup.Find(id); if (freight_lookup == null) { return(HttpNotFound()); } return(View(freight_lookup)); }
// // GET: /Freight_Lookup/Edit/5 public ActionResult Edit(int id = 0) { Freight_Lookup freight_lookup = db.Freight_Lookup.Find(id); ViewBag.Hazardous = LoadHazardous(freight_lookup.Freight_Hazard); if (freight_lookup == null) { return(HttpNotFound()); } return(View(freight_lookup)); }
public ActionResult Edit(Freight_Lookup freight_lookup) { if (ModelState.IsValid) { db.Entry(freight_lookup).State = EntityState.Modified; int userid = int.Parse(Session.Contents["UserID"].ToString()); freight_lookup.ModifiedBy = userid; freight_lookup.ModifiedDate = DateTime.Now; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(freight_lookup)); }
public ActionResult Create([Bind(Exclude = "Freight_Id")] Freight_Lookup freight_lookup) { if (ModelState.IsValid) { db.Freight_Lookup.Add(freight_lookup); int userid = int.Parse(Session.Contents["UserID"].ToString()); freight_lookup.ModifiedBy = userid; freight_lookup.ModifiedDate = DateTime.Now; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(freight_lookup)); }