public ActionResult AddProcessedProductsToPallet(PalletProductAddViewModel model)
        {
            model.DateCreated = DateTime.UtcNow;
            model.CreatedBy   = CurrentUserId;
            var item = _palletingService.AddFulFillmentPalletProduct(model);

            return(Json(item.PalletProductID, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public PalletProduct AddFulFillmentPalletProduct(PalletProductAddViewModel model)
        {
            var orderProcessDetail = _currentDbContext.OrderProcessDetail.First(m => m.OrderProcessDetailID == model.OrderProcessDetailID);
            var fulfillmentProduct = new PalletProduct()
            {
                OrderID = orderProcessDetail.OrderDetail.OrderID,
                OrderProcessDetailID = orderProcessDetail.OrderProcessDetailID,
                PalletID             = model.CurrentPalletID,
                ProductID            = model.ProductID,
                Quantity             = model.PalletQuantity,
                CreatedBy            = model.CreatedBy,
                DateCreated          = model.DateCreated
            };

            _currentDbContext.PalletProducts.Add(fulfillmentProduct);
            _currentDbContext.SaveChanges();

            return(fulfillmentProduct);
        }