Ejemplo n.º 1
0
 public TableMovementWriter(BarcodeData startBarcodeData, BarcodeData finalBarcodeData)
 {
     this.startBarcodeData = startBarcodeData;
     this.finalBarcodeData = finalBarcodeData;
     initTable();
     fillTable();
 }
Ejemplo n.º 2
0
 public TableMovementWriter(BarcodeData startBarcodeData, BarcodeData finalBarcodeData)
 {
     this.startBarcodeData = startBarcodeData;
     this.finalBarcodeData = finalBarcodeData;
     initTable();
     fillTable();
 }
Ejemplo n.º 3
0
        public bool SameWare(BarcodeData barcodeData, bool checkParty)
        {
            if (Nomenclature == null || barcodeData.Nomenclature == null)
            {
                return(false);
            }

            if (barcodeData.Nomenclature.Id != Nomenclature.Id)
            {
                return(false);
            }

            if (checkParty)
            {
                if (!barcodeData.ProductionDate.Equals(ProductionDate))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 4
0
        public static BarcodeData ToBarcodeData(this string barcode)
        {
            var result = new BarcodeData();

            if (string.IsNullOrEmpty(barcode))
            {
                return(result);
            }

            if (barcode.IsShortStickerCode())
            {
                result.StickerId = Convert.ToInt64(barcode.Substring(1));
                return(result);
            }

            barcode = barcode.Replace("$$", "$");

            string[] values = barcode.Split('$');
            if (values.Length < 1)
            {
                return(result);
            }

            result.StickerId = Convert.ToInt64(values[(int)BarcodeDataIndexes.StickerId]);

            if (values.Length < (int)BarcodeDataIndexes.IndexesCount)
            {
                return(result);
            }

            // result.TotalUnitsQuantity = Convert.ToInt32(values[(int)BarcodeDataIndexes.UnitsQuantity]);

            result.Nomenclature.Id = Convert.ToInt64(values[(int)BarcodeDataIndexes.NomenclatureId]);

            return(result);
        }
Ejemplo n.º 5
0
 private void startScanNextPallet()
 {
     setLastPalletNewCellInfo();
     finalBarcodeData = null;
     ShowControls(scanNextPalletControls);
 }
Ejemplo n.º 6
0
        private void onAnotherStickerScan(BarcodeData barcodeData)
        {
            if (barcodeData.StickerId == finalBarcodeData.PreviousStickerCode) return;

            barcodeData.ReadStickerInfo();
            bool cellFounded = barcodeData.Cell.Id != 0;
            if (!cellFounded)
                {
                "³���������� ������ ���� �� ��������".Warning();
                return;
                }
            onCellScan(barcodeData.Cell, barcodeData.StickerId);
        }
Ejemplo n.º 7
0
 private void startScanNextPallet()
 {
     currentBarcodeData = null;
     ShowControls(scanNextPalletControls);
     palletEditControls.cellLabel.SetFontColor(MobileFontColors.Disable);
     cellDefined = false;
     updateFinishCellText();
 }
Ejemplo n.º 8
0
        private void onAnotherStickerScan(BarcodeData barcodeData)
        {
            //if (barcodeData.StickerId == currentBarcodeData.PreviousStickerCode
            //     && !currentBarcodeData.Cell.Empty)
            //    {
            //    notifyCellUpdated();
            //    return;
            //    }

            barcodeData.ReadStickerInfo();
            if (!barcodeData.LocatedInCell)
                {
                showPalletCellNotFountMessage();
                return;
                }

            if (barcodeData.StickerId == currentBarcodeData.PreviousStickerCode
                 && !currentBarcodeData.Cell.Empty
                 && barcodeData.Cell.Id == currentBarcodeData.Cell.Id)
                {
                notifyCellUpdated();
                return;
                }

            if (!string.Format(@"��������� � ������ ""{0}"" ���� ������ � {1}", barcodeData.Cell.Description, barcodeData.StickerId).Ask()) return;

            this.currentBarcodeData.Cell.CopyFrom(barcodeData.Cell);
            this.currentBarcodeData.PreviousStickerCode = barcodeData.StickerId;
            notifyCellUpdated();
        }
Ejemplo n.º 9
0
 private void tryCheckNewSticker(BarcodeData barcodeData)
 {
     if (newStickerId != barcodeData.StickerId)
         {
         if ("Удалить новую этикетку?".Ask())
             {
             newStickerId = 0;
             updateScanPalletLabelText();
             }
         return;
         }
     startCellIdentification();
 }
Ejemplo n.º 10
0
        public static BarcodeData ToBarcodeData(this string barcode)
        {
            var result = new BarcodeData();
            if (string.IsNullOrEmpty(barcode))
                {
                return result;
                }

            if (barcode.IsShortStickerCode())
                {
                result.StickerId = Convert.ToInt64(barcode.Substring(1));
                return result;
                }

            barcode = barcode.Replace("$$", "$");

            string[] values = barcode.Split('$');
            if (values.Length < 1)
                {
                return result;
                }

            result.StickerId = Convert.ToInt64(values[(int)BarcodeDataIndexes.StickerId]);

            if (values.Length < (int)BarcodeDataIndexes.IndexesCount)
                {
                return result;
                }

            // result.TotalUnitsQuantity = Convert.ToInt32(values[(int)BarcodeDataIndexes.UnitsQuantity]);

            result.Nomenclature.Id = Convert.ToInt64(values[(int)BarcodeDataIndexes.NomenclatureId]);

            return result;
        }
Ejemplo n.º 11
0
 public bool SameWare(BarcodeData barcodeData)
 {
     return(SameWare(barcodeData, true));
 }
Ejemplo n.º 12
0
 private void startScanNextPallet()
 {
     currentBarcodeData = null;
     ShowControls(scanNextPalletControls);
 }
Ejemplo n.º 13
0
        private void scanNextPalletOnBarcode(string barcode)
        {
            if (!barcode.IsSticker()) return;

            var barcodeData = barcode.ToBarcodeData();

            if (acceptanceId == 0 && !initAcceptance(barcodeData.StickerId))
                {
                return;
                }

            bool currentAcceptance;
            readStickerInfo(false, acceptanceId, barcodeData, out currentAcceptance);
            if (barcodeData.StickerId == 0)
                {
                waitingForWareBarcode = false;
                string.Format("������ {0} ���� � ��������.", barcodeData.StickerId).Warning();
                return;
                }

            if (!currentAcceptance)
                {
                waitingForWareBarcode = false;
                "³����������� ����� �� ������� �� ���������!".Warning();
                return;
                }

            currentBarcodeData = barcodeData;

            ShowControls(palletEditControls);

            updateStickerData();
        }
Ejemplo n.º 14
0
        private void readStickerInfo(bool tryingToLocate, long acceptanceId, BarcodeData barcodeData, out bool currentAcceptance)
        {
            string nomenclatureDescription;
            long trayId;
            int unitsPerBox;
            string cellDescription;
            long cellId;
            long nomenclatureId;
            int totalUnitsQuantity;
            int wareBarcodesCount;

            if (
                !Program.AramisSystem.GetStickerData(acceptanceId, barcodeData.StickerId,
                    out nomenclatureId, out nomenclatureDescription, out trayId,
                    out totalUnitsQuantity, out unitsPerBox, out cellId, out cellDescription, out currentAcceptance, out wareBarcodesCount))
                {
                barcodeData.StickerId = 0;
                return;
                }

            barcodeData.TotalUnitsQuantity = totalUnitsQuantity;
            barcodeData.Nomenclature.Id = nomenclatureId;
            barcodeData.Nomenclature.Description = nomenclatureDescription;

            barcodeData.Tray.Id = trayId;
            barcodeData.Tray.Description = new Repository().GetTrayDescription(trayId);

            barcodeData.UnitsPerBox = Convert.ToInt32(unitsPerBox);
            barcodeData.Cell.Description = cellDescription;
            barcodeData.Cell.Id = cellId;

            if (!tryingToLocate
                && barcodeData.StickerId > 0
                && wareBarcodesCount == 0
                && "��� ������ ��������� ��� �����-�����. ���������������� �����?".Ask())
                {
                waitingForWareBarcode = true;
                "���������� ����� ������� ���������".ShowMessage();
                }
        }
Ejemplo n.º 15
0
 public bool SameWare(BarcodeData barcodeData)
 {
     return SameWare(barcodeData, true);
 }
Ejemplo n.º 16
0
        public bool SameWare(BarcodeData barcodeData, bool checkParty)
        {
            if (Nomenclature == null || barcodeData.Nomenclature == null) return false;

            if (barcodeData.Nomenclature.Id != Nomenclature.Id) return false;

            if (checkParty)
                {
                if (!barcodeData.ProductionDate.Equals(ProductionDate)) return false;
                }

            return true;
        }
Ejemplo n.º 17
0
        protected override void OnBarcode(string barcode)
        {
            barcode = barcode.Replace("\r\r", "$$");

            if (!scanPallet.Visible) return;
            if (!barcode.IsSticker()) return;

            var barcodeData = barcode.ToBarcodeData();
            if (lastScannedPalletId == barcodeData.StickerId
                && "��������� ��������".Ask())
                {
                if (!new StickersPrinting(barcodeData.StickerId).Print())
                    {
                    Warning_CantComplateOperation();
                    }
                return;
                }

            lastScannedPalletId = barcodeData.StickerId;

            if (!barcodeData.ReadStickerInfo())
                {
                Warning_CantComplateOperation();
                return;
                }

            if (barcodeData.StickerId == pickingTaskData.StickerId)
                {
                factPickingData = pickingTaskData.GetCopy();
                }
            else
                {
                if (pickingTaskData.SameWare(barcodeData, false)
                    &&
                    (pickingTaskData.StickerId == 0
                    || true//string.Format("��������� ����� � ������� {0}", barcodeData.StickerId).Ask()
                    ))
                    {
                    factPickingData = barcodeData;
                    showParty(factPickingData.Party);
                    }
                else
                    {
                    sameWareNextTaskLineNumber = 0;
                    if (startPalletChoosing(barcodeData.StickerId, currentLineNumber))
                        {
                        lastScannedPalletId = 0;
                        OnBarcode(barcode);
                        }
                    return;
                    }
                }

            setCellDescription(barcodeData.Cell);
            factPickingData.Cell.CopyFrom(barcodeData.Cell);
            factPickingData.Party.CopyFrom(barcodeData.Party);

            totalUnitsQuantityOnPallet = barcodeData.TotalUnitsQuantity;
            factPickingData.LinersAmount = barcodeData.LinersAmount;
            factPickingData.Liner.CopyFrom(barcodeData.Liner);
            factPickingData.Tray.CopyFrom(barcodeData.Tray);

            packsCount = pickingTaskData.FullPacksCount;
            unitsCount = pickingTaskData.UnitsRemainder;
            quantityEditControls.packsCountTextBox.Focus();
            quantityEditControls.Show();
            scanPallet.Hide();

            showLinersControls(barcodeData);
        }
Ejemplo n.º 18
0
        private void acceptWare(BarcodeData barcodeData)
        {
            barcodeData.ReadStickerInfo();
            var itIsNewPallet = barcodeData.StickerId == newStickerId;
            if (!itIsNewPallet)
                {
                if (barcodeData.Nomenclature.Id != currentWare.Id)
                    {
                    string.Format("Продукция в паллете другая: {0}", barcodeData.Nomenclature.Description).ShowMessage();
                    return;
                    }

                if (barcodeData.Party.Id != currentParty.Id)
                    {
                    string.Format("Дата производства в паллете другая: {0}", barcodeData.Party.Description)
                        .ShowMessage();
                    return;
                    }

                if (barcodeData.Liner.Id > 0 && barcodeData.Liner.Id != currentLiner.Id && !currentLiner.Empty)
                    {
                    string.Format("В указанной паллете используются другой вид прокладок: {0}", barcodeData.Liner.Description)
                        .ShowMessage();
                    return;
                    }

                if (!barcodeData.LocatedInCell)
                    {
                    "Паллеты нет на остатках".ShowMessage();
                    return;
                    }
                currentCell = barcodeData.Cell;
                }

            if (acceptanceId == 0 && !Program.AramisSystem.CreateNewAcceptance(out acceptanceId))
                {
                notifyUserIfConnectionIsBroken();
                return;
                }

            if (!Program.AramisSystem.WriteStickerFact(acceptanceId, barcodeData.StickerId, false,
                            currentCell.Id, previousStickerId, 0, currentLiner.Id, returnWareControls.LinersCountTextBox.GetNumber(),
                            returnWareControls.PacksCountTextBox.GetNumber(), returnWareControls.UnitsCountTextBox.GetNumber()))
                {
                return;
                }

            startNewIdentification();
        }
Ejemplo n.º 19
0
        private void proceed()
        {
            factPickingData.TotalUnitsQuantity = unitsCount + packsCount * factPickingData.UnitsPerBox;

            var palletNotEmptyNow = totalUnitsQuantityOnPallet != factPickingData.TotalUnitsQuantity;
            if (palletNotEmptyNow)
                {
                factPickingData.LinersAmount = linersCount;
                }

            pickingTaskData.Tray.CopyFrom(factPickingData.Tray);
            pickingTaskData.Liner.CopyFrom(factPickingData.Liner);
            pickingTaskData.LinersAmount = factPickingData.LinersAmount;

            var resultWriter = new TableMovementWriter(pickingTaskData, factPickingData);
            resultWriter.SetStartCell(factPickingData.Cell);

            int _sameWareNextTaskLineNumber;
            var success = Program.AramisSystem.WritePickingResult(documentId, currentLineNumber, resultWriter.Table, factPickingData.Party.Id, out _sameWareNextTaskLineNumber);
            if (success)
                {
                factPickingData = null;
                this.sameWareNextTaskLineNumber = _sameWareNextTaskLineNumber;
                startPalletChoosing(0, 0);
                }
            else if (lastQueryIsSuccessfull)
                {
                "���� ������� �� ���������".Warning();
                }
        }
Ejemplo n.º 20
0
        private void handlePalletCode(BarcodeData barcodeData)
        {
            if (!barcodeData.ReadStickerInfo())
                {
                return;
                }

            if (!processedPallets.ContainsKey(barcodeData.StickerId))
                {
                processedPallets.Add(barcodeData.StickerId, true);
                }

            currentNomenclatureLabel.Text = barcodeData.Nomenclature.Description;
            currentStickerIdTextBox.Text = barcodeData.StickerId.ToString();

            updatePrintTask();
        }
Ejemplo n.º 21
0
        private bool readNextPickingTask(long palletId, int predefinedTaskLineNumber, int _currentLineNumber, out BarcodeData pickingPlan)
        {
            pickingPlan = null;
            long stickerId;
            long wareId;
            string wareDescription;
            long cellId;
            string cellDescription;
            long partyId;
            DateTime productionDate;
            int unitsPerBox;
            int unitsToPick;
            int taskLineNumber;

            if (!Program.AramisSystem.GetPickingTask(documentId, palletId, predefinedTaskLineNumber, _currentLineNumber,
                out stickerId,
                out wareId, out wareDescription,
                out cellId, out cellDescription,
                out partyId, out productionDate,
                out unitsPerBox, out unitsToPick,
                out taskLineNumber)) return false;

            currentLineNumber = taskLineNumber;
            pickingPlan = new BarcodeData();
            pickingPlan.Nomenclature.Id = wareId;
            pickingPlan.Nomenclature.Description = wareDescription;
            pickingPlan.Cell.Id = cellId;
            pickingPlan.Cell.Description = cellDescription;
            pickingPlan.UnitsPerBox = unitsPerBox;
            pickingPlan.StickerId = stickerId;
            pickingPlan.TotalUnitsQuantity = unitsToPick;
            pickingPlan.Party.Description = productionDate.ToStandartString();
            pickingPlan.Party.Id = partyId;

            return true;
        }
Ejemplo n.º 22
0
        private void scanNextPalletOnBarcode(string barcode)
        {
            if (barcode.IsCell())
                {
                clearCell(barcode.ToCell());
                return;
                }
            if (!barcode.IsSticker()) return;

            var barcodeData = barcode.ToBarcodeData();

            if (processedPallets.ContainsKey(barcodeData.StickerId))
                {
                "�� ������ ��� ���� ���������".ShowMessage();
                return;
                }

            if (!barcodeData.ReadStickerInfo()) return;

            startBarcodeData = barcodeData;
            currentBarcodeData = barcodeData.GetCopy();

            ShowControls(palletEditControls);

            updateStickerData();
        }
Ejemplo n.º 23
0
        private void showLinersControls(BarcodeData barcodeData)
        {
            var controlsVisible = barcodeData.Liner.Id != Program.Consts.WoodLinerId && barcodeData.LinersAmount > 0;
            quantityEditControls.linersCountTextBox.Visible = controlsVisible;
            quantityEditControls.linersLabel.Visible = controlsVisible;

            quantityEditControls.linersCountTextBox.Text = controlsVisible ? string.Empty : barcodeData.LinersAmount.ToString();
        }
Ejemplo n.º 24
0
        private void writeInventoryResult(string[] parameters)
        {
            if (documentId == 0 && !initDocument())
                {
                return;
                }

            if (parameters.Length == 2)
                {
                var succ = Program.AramisSystem.FinishCellInventory(documentId, currentCell.Id, currentCellPallets);
                currentCellPallets.Rows.Clear();
                return;
                }

            var startData = new BarcodeData() { StickerId = Convert.ToInt64(parameters[1]) };
            startData.ReadStickerInfo();

            var resultData = new BarcodeData() { StickerId = startData.StickerId, PreviousStickerCode = Convert.ToInt64(parameters[2]) };
            resultData.Cell.Id = Convert.ToInt64(parameters[0]);

            resultData.Nomenclature.Id = Convert.ToInt32(parameters[7]);
            resultData.Tray.Id = Convert.ToInt64(parameters[4]);
            resultData.Liner.Id = Convert.ToInt64(parameters[5]);
            resultData.LinersAmount = Convert.ToInt32(parameters[6]);

            resultData.TotalUnitsQuantity = Convert.ToInt32(parameters[3]);

            currentCell.Id = resultData.Cell.Id;
            currentCellPallets.Rows.Add(startData.StickerId);

            var movementWriter = new TableMovementWriter(startData, resultData);
            bool result = Program.AramisSystem.WriteInventoryResult(documentId, movementWriter.Table);
        }
Ejemplo n.º 25
0
        private bool startPalletChoosing(long palletId, int _currentLineNumber)
        {
            int predefinedTaskLineNumber = sameWareNextTaskLineNumber;
            quantityEditControls.Hide();
            scanPallet.Show();

            BarcodeData pickingPlan;
            if (!readNextPickingTask(palletId, predefinedTaskLineNumber, _currentLineNumber, out pickingPlan))
                {
                pickingTaskData = new BarcodeData();
                "���� ��'���� � ��������. ������� WiFi �� �������� ��� (F5)".ShowMessage();
                return false;
                }

            if (pickingPlan.Empty)
                {
                if (palletId > 0)
                    {
                    "³���������� ��������� �� ����������� ��� ������!".Warning();
                    return false;
                    }
                ComplateOperation();
                return true;
                }

            pickingTaskData = pickingPlan;

            setCellDescription(pickingTaskData.Cell);

            int separationPosition = Math.Min(pickingTaskData.Nomenclature.Description.Length - 1, 24);
            pickingTask.pickingWareLine1.Text = pickingTaskData.Nomenclature.Description.Substring(0, separationPosition);
            pickingTask.pickingWareLine2.Text = pickingTaskData.Nomenclature.Description.Substring(separationPosition);

            showParty(pickingTaskData.Party);

            var unitsQuantityStr = pickingTaskData.UnitsRemainder == 0
                ? string.Empty
                : " + " + pickingTaskData.UnitsRemainder.ToString();
            pickingTask.planedQuantity.Text = string.Format("{0} �� {1}{2}", pickingTaskData.FullPacksCount,
                pickingTaskData.UnitsPerBox, unitsQuantityStr);

            return true;
        }