Ejemplo n.º 1
0
        private void Combos_Add(object sender, OrderEventArgs e)
        {
            var orderId = _viewModel.CurrentOrderId;
            var entity  = new OrderCombo
            {
                Order            = _orderRepository.Get(orderId),
                Product          = _productRepository.Get(e.ProductId),
                CustomerLocation = _customerLocationRepository.Get(e.LocationId),
                Quantity         = e.Quantity,
                Weight           = e.Weight
            };

            _orderComboRepository.Add(entity);
            _orderComboRepository.Save();
            _viewModel.CombosSource.Orders.Add(new OrderConstructorViewModel
            {
                Id          = entity.Id,
                LocationId  = e.LocationId,
                ProductId   = e.ProductId,
                ProductName = entity.Product.Upc,
                Qty         = e.Quantity,
                ShipTo      = entity.CustomerLocation.Name,
                Weight      = e.Weight
            });
            _labelCreateService.ProduceLabel(e.OrderDetailId, Convert.ToDouble(e.Weight), OmsLabelType.Box, e.Quantity,
                                             _viewModel.ProcessDate, null, null, null);
        }
Ejemplo n.º 2
0
        public OmsScaleWeighStatus WeighAndLabel(int orderDetailId, OmsLabelType labelType)
        {
            var scaleId = Convert.ToInt32(ConfigurationManager.AppSettings["ScaleId"]);

            if (SessionService.Get().BagScale == null)
            {
                SessionService.Get().BagScale = InitializeScale(scaleId);
            }

            var scaleWeight = SessionService.Get().BagScale.GetWeight();
            var status      = scaleWeight.Status;

            if (status == OmsScaleWeighStatus.Success)
            {
                _labelCreateService.ProduceLabel(orderDetailId, scaleWeight, labelType, null);
            }

            return(status);
        }
Ejemplo n.º 3
0
 private void RecordReading(Zq375 zq375, ReadingEventArgs args)
 {
     if (args.Weight.Status == OmsScaleWeighStatus.Success)
     {
         if (_activeOrderDetailId > 0)
         {
             _labelCreateService.ProduceLabel(_activeOrderDetailId, args.Weight, OmsLabelType.Bag, null);
             DisplayScaleOutput(args.Weight.FormattedDisplay);
         }
         else
         {
             DisplayScaleOutput(String.Format("Order Detail must be set to value"));
         }
     }
     else
     {
         DisplayScaleOutput(String.Format("error reading scale. Scale Status: [{0}]", args.Weight.Status));
     }
 }