// GET: ExpeditedFreights/Edit/5 public ActionResult Edit(int?id) { var expeditedfreights = db.ExpeditedFreights.SingleOrDefault(c => c.ExpeditedFreightId == id); var statuses = db.Statuses.ToList(); var customers = db.Customers.ToList(); var customerdivisions = db.CustomerDivisions.ToList(); var mlsdivisions = db.MlsDivisions.ToList(); var viewModel = new SaveExpFreightViewModel() { ExpeditedFreight = expeditedfreights, Statuses = statuses, Customers = customers, CustomerDivisions = customerdivisions, MlsDivisions = mlsdivisions }; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExpeditedFreight expeditedFreight = db.ExpeditedFreights.Find(id); if (expeditedFreight == null) { return(HttpNotFound()); } return(View("Edit", viewModel)); //return View(expeditedFreight); }
// GET: ExpeditedFreights/Create public ActionResult Create() { var statuses = db.Statuses.ToList(); var customers = db.Customers.ToList(); var customerdivisions = db.CustomerDivisions.ToList(); var mlsdivisions = db.MlsDivisions.ToList(); var viewModel = new SaveExpFreightViewModel() { Statuses = statuses, Customers = customers, CustomerDivisions = customerdivisions, MlsDivisions = mlsdivisions }; return(View("Create", viewModel)); }