public IHttpActionResult GetShipOrderInfo([FromUri] int shipOrderId, [FromUri] string operation)
        {
            if (operation == "BOL")
            {
                var pickDetailsInDb = _context.FBAPickDetails
                                      .Include(x => x.FBAShipOrder)
                                      .Include(x => x.FBAPickDetailCartons)
                                      .Include(x => x.FBAPalletLocation.FBAPallet.FBACartonLocations)
                                      .Where(x => x.FBAShipOrder.Id == shipOrderId)
                                      .ToList();

                var bolList = GenerateFBABOLList(pickDetailsInDb);

                var generator = new FBAExcelGenerator(@"D:\Template\BOL-Template.xlsx");

                var fileName = generator.GenerateExcelBol(shipOrderId, bolList);

                return(Ok(fileName));
            }
            else if (operation == "Update")
            {
                return(Ok(Mapper.Map <FBAShipOrder, FBAShipOrderDto>(_context.FBAShipOrders.Find(shipOrderId))));
            }
            else if (operation == "WO")
            {
                var shipOrder = _context.FBAShipOrders
                                .Include(x => x.FBAPickDetails)
                                .Include(x => x.ChargingItemDetails)
                                .SingleOrDefault(x => x.Id == shipOrderId);

                return(Ok(GenerateWorkOrder(shipOrder)));
            }

            return(Ok());
        }
示例#2
0
        public IHttpActionResult DownloadBOL([FromUri] int masterOrderId, [FromUri] string freightCharge, [FromUri] string operatorName, [FromBody] BOLInfo bolInfo)
        {
            var bolList = GenerateFBABOLList(bolInfo.OrderDetails);

            var generator = new FBAExcelGenerator(@"D:\Template\BOL-Template.xlsx");

            var fileName = generator.GenerateExcelBol(masterOrderId, FBAOrderType.MasterOrder, bolList, freightCharge, bolInfo.BOLDetail);

            return(Ok(fileName));
        }