public void Update(ShipmentsModel shipment) { ShipmentId = shipment.ShipmentId; Tracking = shipment.Tracking; PawzeUserId = shipment.PawzeUserId; ShipmentDate = shipment.ShipmentDate; }
public IHttpActionResult PostShipment(ShipmentsModel shipment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var dbShipment = new Shipment(); _shipmentRepository.Add(dbShipment); _unitOfWork.Commit(); shipment.ShipmentId = dbShipment.ShipmentId; return(CreatedAtRoute("DefaultApi", new { id = shipment.ShipmentId }, shipment)); }
public IHttpActionResult PutShipment(int id, ShipmentsModel shipment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != shipment.ShipmentId) { return(BadRequest()); } Shipment dbShipment = _shipmentRepository.GetById(id); dbShipment.Update(shipment); _shipmentRepository.Update(dbShipment); try { _unitOfWork.Commit(); } catch (Exception) { if (!ShipmentExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
/// <summary> /// Displays the shipments. /// </summary> /// <returns>ActionResult.</returns> public ActionResult DisplayShipments() { var model = new ShipmentsModel { Shipments = GetShipinngMethodModels() }; return PartialView("Shipments", model); }
public IActionResult Index(ShipmentsModel shipmentModel) { return(View(shipmentModel)); }
public Shipment(ShipmentsModel shipment) { this.Update(shipment); }