示例#1
0
 public TableMovementWriter(BarcodeData startBarcodeData, BarcodeData finalBarcodeData)
 {
     this.startBarcodeData = startBarcodeData;
     this.finalBarcodeData = finalBarcodeData;
     initTable();
     fillTable();
 }
示例#2
0
 public TableMovementWriter(BarcodeData startBarcodeData, BarcodeData finalBarcodeData)
 {
     this.startBarcodeData = startBarcodeData;
     this.finalBarcodeData = finalBarcodeData;
     initTable();
     fillTable();
 }
示例#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);
        }
示例#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);
        }
示例#5
0
文件: Movement.cs 项目: AramisIT/FMCG
 private void startScanNextPallet()
 {
     setLastPalletNewCellInfo();
     finalBarcodeData = null;
     ShowControls(scanNextPalletControls);
 }
示例#6
0
文件: Movement.cs 项目: AramisIT/FMCG
        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);
        }
示例#7
0
 private void startScanNextPallet()
 {
     currentBarcodeData = null;
     ShowControls(scanNextPalletControls);
     palletEditControls.cellLabel.SetFontColor(MobileFontColors.Disable);
     cellDefined = false;
     updateFinishCellText();
 }
示例#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();
        }
示例#9
0
 private void tryCheckNewSticker(BarcodeData barcodeData)
 {
     if (newStickerId != barcodeData.StickerId)
         {
         if ("Удалить новую этикетку?".Ask())
             {
             newStickerId = 0;
             updateScanPalletLabelText();
             }
         return;
         }
     startCellIdentification();
 }
示例#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;
        }
示例#11
0
 public bool SameWare(BarcodeData barcodeData)
 {
     return(SameWare(barcodeData, true));
 }
示例#12
0
 private void startScanNextPallet()
 {
     currentBarcodeData = null;
     ShowControls(scanNextPalletControls);
 }
示例#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();
        }
示例#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();
                }
        }
示例#15
0
 public bool SameWare(BarcodeData barcodeData)
 {
     return SameWare(barcodeData, true);
 }
示例#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;
        }
示例#17
0
文件: Picking.cs 项目: AramisIT/FMCG
        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);
        }
示例#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();
        }
示例#19
0
文件: Picking.cs 项目: AramisIT/FMCG
        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();
                }
        }
示例#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();
        }
示例#21
0
文件: Picking.cs 项目: AramisIT/FMCG
        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;
        }
示例#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();
        }
示例#23
0
文件: Picking.cs 项目: AramisIT/FMCG
        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();
        }
示例#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);
        }
示例#25
0
文件: Picking.cs 项目: AramisIT/FMCG
        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;
        }