//public virtual ActionResult GetPackingSlipWithCoupon(long orderId) //{ // LogI("GetSamplePackingSlip, orderId=" + orderId); // try // { // var orders = PackingSlipViewModel.GetList(Db, new[] { orderId }, SortMode.None, true).ToList(); // var model = new PackingSlipCollectionModel // { // ReturnAddress = AccessManager.Company.GetReturnAddressDto(), // PackingSlips = orders, // }; // var marketplaces = new MarketplaceKeeper(DbFactory); // marketplaces.Init(); // model.Marketplaces = marketplaces.GetAll().Select(m => new PackingSlipMarketplaceInfo(m)).ToList(); // return View("PackingSlipWithCoupon", model); // } // catch (Exception ex) // { // LogE("GetPackingSlip", ex); // throw; // } //} public virtual ActionResult GetPackingSlipsForBatch(long batchId) { LogI("GetPackingSlipsForBatch, batchId=" + batchId); var orderIds = Db.OrderBatches.GetOrderIdsForBatch(batchId, OrderStatusEnumEx.AllUnshippedWithShipped); var orders = PackingSlipViewModel.GetList(Db, orderIds, SortMode.ByShippingMethodThenLocation, false).ToList(); var companyAddress = new CompanyAddressService(AccessManager.Company); var batch = Db.OrderBatches.Get(batchId); var model = new PackingSlipCollectionModel { BatchId = batch.Id, BatchName = batch.Name, Date = Time.GetAppNowTime(), ReturnAddress = companyAddress.GetReturnAddress(MarketIdentifier.Empty()), PackingSlips = orders, }; var marketplaces = new MarketplaceKeeper(DbFactory, false); marketplaces.Init(); model.Marketplaces = marketplaces.GetAll().Select(m => new PackingSlipMarketplaceInfo(m)).ToList(); return(View("PackingSlip", model)); }
public virtual ActionResult GetPackingSlip(long orderId) { LogI("GetPackingSlip, orderId=" + orderId); try { var companyAddress = new CompanyAddressService(AccessManager.Company); var orders = PackingSlipViewModel.GetList(Db, new[] { orderId }, SortMode.None, true).ToList(); var model = new PackingSlipCollectionModel { ReturnAddress = companyAddress.GetReturnAddress(MarketIdentifier.Empty()), PackingSlips = orders, }; var marketplaces = new MarketplaceKeeper(DbFactory, false); marketplaces.Init(); model.Marketplaces = marketplaces.GetAll().Select(m => new PackingSlipMarketplaceInfo(m)).ToList(); return(View("PackingSlip", model)); } catch (Exception ex) { LogE("GetPackingSlip", ex); throw; } }