示例#1
0
        public String GetCarton(String BoxNumber)
        {
            String _return = "";
            int    total   = 0;
            int    outOf   = 1;

            List <cstCartonInfo> _CartonByShipmentNumber = _carton.GetCartonByShipmentNumber(Global.ShippingNumber);
            cstCartonInfo        _cartonBox = _CartonByShipmentNumber.SingleOrDefault(i => i.BOXNumber == BoxNumber);

            foreach (var item in _CartonByShipmentNumber)
            {
                if (item.CartonNumber == _cartonBox.CartonNumber)
                {
                    total = total + 1;

                    if (item.Printed != 0)
                    {
                        outOf = outOf + 1;
                    }
                }
            }
            if (total < outOf)
            {
                outOf = total - 1;
            }

            _return = outOf.ToString() + " of " + total.ToString();
            return(_return);
        }
示例#2
0
        public void fillGrid(string ShipmentNum)
        {
            try
            {
                lscarton = carton.GetCartonByShipmentNumber(ShipmentNum);
                List <Gridclass> lsgrid = new List <Gridclass>();
                foreach (var item in lscarton)
                {
                    Gridclass check = new Gridclass();
                    check.boxnumber = item.BOXNumber;
                    if (item.Printed == 0)
                    {
                        check.Status = "Not Printed";
                    }
                    else
                    {
                        check.Status = "Printed";
                    }
                    lsgrid.Add(check);
                }

                grdContent.ItemsSource = lsgrid;
                txtBoxNumberScanned.Focus();
            }
            catch (Exception Ex)
            {
                ErrorLoger.save("wndBoxInfo - FillGrid", "[" + DateTime.UtcNow.ToString() + "]" + Ex.ToString(), DateTime.UtcNow, Global.LoggedUserId);
            }
        }