// GET: ShipOuts/Edit/5 public ActionResult Edit(int?id) { var shipouts = db.ShipOuts.SingleOrDefault(c => c.ShipOutId == id); var customers = db.Customers.ToList(); var customerdivisions = db.CustomerDivisions.ToList(); var freighttypes = db.FreightTypes.ToList(); var fpaymentmethods = db.FPaymentMethods.ToList(); var viewModel = new SaveShipOutViewModel() { ShipOut = shipouts, Customers = customers, CustomerDivisions = customerdivisions, FreightTypes = freighttypes, FPaymentMetods = fpaymentmethods }; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShipOut shipOut = db.ShipOuts.Find(id); if (shipOut == null) { return(HttpNotFound()); } return(View("Edit", viewModel)); }
public IHttpActionResult PutShipOut(int id, ShipOut shipOut) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != shipOut.ShipOutId) { return(BadRequest()); } db.Entry(shipOut).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ShipOutExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { ShipOut shipOut = db.ShipOuts.Find(id); db.ShipOuts.Remove(shipOut); db.SaveChanges(); return(RedirectToAction("Index", "ShipIns")); }
//public ActionResult Edit([Bind(Include = "ShipOutId,CustomerId,CustomerDivisionId,FreightTypeId,FPaymentMethodId,Carrier,TrackingInfo,Destination,Quote,SoldTo,ShipTo,ShipCity,ShipState,ShipZip,ShipDescription,ShipWeight,ManifestNo,PoNumber,SoNumber,PalletNo,Pn,Sn,ShipDate,Quantity")] ShipOut shipOut) public ActionResult Edit(ShipOut shipOut) { if (ModelState.IsValid) { db.Entry(shipOut).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "ShipIns")); } return(View()); }
public IHttpActionResult GetShipOut(int id) { ShipOut shipOut = db.ShipOuts.Find(id); if (shipOut == null) { return(NotFound()); } return(Ok(shipOut)); }
public IHttpActionResult PostShipOut(ShipOut shipOut) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ShipOuts.Add(shipOut); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = shipOut.ShipOutId }, shipOut)); }
//public ActionResult Create([Bind(Include = "ShipOutId,CustomerId,CustomerDivisionId,FreightTypeId,FPaymentMethodId,Carrier,TrackingInfo,Destination,Quote,SoldTo,ShipTo,ShipCity,ShipState,ShipZip,ShipDescription,ShipWeight,ManifestNo,PoNumber,SoNumber,PalletNo,Pn,Sn,ShipDate,Quantity")] ShipOut shipOut) public ActionResult Create(ShipOut shipOut) { if (ModelState.IsValid) { db.ShipOuts.Add(shipOut); db.SaveChanges(); return(RedirectToAction("Index", "ShipIns")); } return(View()); //return View(shipOut); }
public IHttpActionResult DeleteShipOut(int id) { ShipOut shipOut = db.ShipOuts.Find(id); if (shipOut == null) { return(NotFound()); } db.ShipOuts.Remove(shipOut); db.SaveChanges(); return(Ok(shipOut)); }
// GET: ShipOuts/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShipOut shipOut = db.ShipOuts.Find(id); if (shipOut == null) { return(HttpNotFound()); } return(View(shipOut)); }