Exemplo n.º 1
0
 private void CheckTimer_Tick(object sender, EventArgs e)
 {
     if (!BarcodeTextBox.Focused)
     {
         BarcodeTextBox.Focus();
     }
 }
Exemplo n.º 2
0
        private void NextToScanPackagesButton_Click(object sender, EventArgs e)
        {
            CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty, "Нажата кнопка Далее; SelectPanel");
            if (string.IsNullOrWhiteSpace(PackagesCountTextBox.Text) || Convert.ToInt32(PackagesCountTextBox.Text) == 0)
            {
                CheckTray.AddEvent(true, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty,
                                   "Не введено кол-во упаковок на поддоне либо кол-во=0; SelectPanel; return");
                Infinium.LightMessageBox.Show(ref TopForm, false,
                                              "Не введено кол-во упаковок на поддоне либо кол-во равно нулю", "Внимание");
                PackagesCountTextBox.Focus();
                return;
            }

            TotalPackCount     = Convert.ToInt32(PackagesCountTextBox.Text);
            CheckTimer.Enabled = true;
            ScanPackagesPanel.BringToFront();
            BarcodeTextBox.Focus();
            CheckTray.CurrentClientID   = Convert.ToInt32(ClientsComboBox.SelectedValue);
            CheckTray.CurrentClientName = ClientsComboBox.Text;

            if (CheckTray.CurrentGroupType == 2)
            {
                CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty,
                                   "Выбран клиент: " + CheckTray.CurrentClientName);
            }

            CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, -1, -1, string.Empty, string.Empty,
                               "Формирование поддона продолжено; SelectPanel; ScanPackagesPanel.BringToFront()");
        }
Exemplo n.º 3
0
 public void BarCodeByHands()
 {
     BarcodeLabel.Visible   = true;
     BarcodeTextBox.Enabled = true;
     BarcodeTextBox.Visible = true;
     Command.Visible        = false;
     BarcodeTextBox.Focus();
 }
 private void BarcodeTextBox_OnKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         InventoryItemFromBarcode();
         BarcodeTextBox.Clear();
     }
 }
Exemplo n.º 5
0
 private void NavigateMenuCloseButton_MouseUp(object sender, MouseEventArgs e)
 {
     if (!CanAction)
     {
         return;
     }
     BarcodeTextBox.Focus();
 }
 private void MakeManualLoginVisible()
 {
     BarcodeLabel.Visible   = true;
     BarcodeTextBox.Visible = true;
     MyOkButton.Visible     = true;
     AcceptButton           = MyOkButton;
     Height += _shrinkDistance;
     BarcodeTextBox.Select();
 }
Exemplo n.º 7
0
 private void PalleteLabelCheckForm_Shown(object sender, EventArgs e)
 {
     while (!SplashForm.bCreated)
     {
         ;
     }
     FormEvent            = eShow;
     AnimateTimer.Enabled = true;
     BarcodeTextBox.Focus();
 }
Exemplo n.º 8
0
        public void SaveData()
        {
            _statusBar.StatusText = "Saving Output to " + XlsFileName;

            Dialogs.ShowLongOperationDialog(new Action(() =>
            {
                ExcelPackage pck         = new ExcelPackage(new FileInfo(XlsFileName));
                ExcelWorksheet workSheet = pck.Workbook.Worksheets[1];

                var start = workSheet.Dimension.Start;
                var end   = workSheet.Dimension.End;

                //Write our count header.
                workSheet.Cells["BA1"].Value = "Num Times Found";

                foreach (SpreadSheetRow row in Rows)
                {
                    //Found the barcode on the spreadsheet, highlight it green
                    if (row.Found == true)
                    {
                        workSheet.Row(row.RowId + 1).Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        workSheet.Row(row.RowId + 1).Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(176, 255, 122));
                    }
                    else
                    {
                        workSheet.Row(row.RowId + 1).Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        workSheet.Row(row.RowId + 1).Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(255, 122, 122));
                    }

                    workSheet.Cells["BA" + (row.RowId + 1)].Value = row.FoundCount;
                }


                if (pck.Workbook.Worksheets["Scanned But Not Found"] == null)
                {
                    //Create new worksheet to save everything they scanned, but didn't find on the spreadsheet
                    pck.Workbook.Worksheets.Add("Scanned But Not Found");
                }

                ExcelWorksheet scannedWorksheet = pck.Workbook.Worksheets["Scanned But Not Found"];
                int i = 0;
                foreach (string code in Scans)
                {
                    string coords = string.Format("A{0}", (i + 1));
                    scannedWorksheet.Cells[coords].Value = code;
                    i++;
                }


                pck.Save();
            }), "Saving...");
            BarcodeTextBox.Focus();
            BarcodeTextBox.Select(0, BarcodeTextBox.Text.Length);
            _statusBar.StatusText = "Successfully Saved " + XlsFileName;
        }
Exemplo n.º 9
0
        private void NextToCheckPackagesButton_Click(object sender, EventArgs e)
        {
            CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Нажата кнопка Далее; ScanPackagesPanel");
            if (CheckTray.ScanPackgesCount < 1)
            {
                CheckTray.AddEvent(true, -1, -1, -1, -1, string.Empty, string.Empty, "Не отсканировано ни одной этикетки; ScanPackagesPanel; return");
                Infinium.LightMessageBox.Show(ref TopForm, false, "Не отсканировано ни одной этикетки", "Внимание");
                return;
            }

            CheckTimer.Enabled = false;

            if (CheckTray.ScanPackgesCount != TotalPackCount)
            {
                CheckTray.AddEvent(true, -1, -1, -1, -1, string.Empty, string.Empty,
                                   "Количество отсканированных этикеток не равно первоначально заявленному. Продолжить?; ScanPackagesPanel");
                bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true,
                                                              "Количество отсканированных этикеток не равно " + TotalPackCount + ". Всё равно продолжить?", "Внимание");

                if (!OKCancel)
                {
                    CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty,
                                       "Количество отсканированных этикеток не равно первоначально заявленному. Задумался; ScanPackagesPanel");
                    CheckTimer.Enabled = true;
                    BarcodeTextBox.Focus();
                    return;
                }

                CheckTray.AddEvent(true, -1, -1, -1, -1, string.Empty, string.Empty,
                                   "Количество отсканированных этикеток не равно первоначально заявленному. Игнорирование!; ScanPackagesPanel");
            }

            Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }

            CheckTray.FillPackages();

            while (SplashWindow.bSmallCreated)
            {
                SmallWaitForm.CloseS = true;
            }

            CheckTray.Clear();
            ErrorPackLabel.Visible = false;

            CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty,
                               "Количество отсканированных этикеток не равно первоначально заявленному. Игнорирование!; ScanPackagesPanel; CheckPackagesPanel.BringToFront()");
            CheckPackagesPanel.BringToFront();
        }
Exemplo n.º 10
0
 private void CheckTimer_Tick(object sender, EventArgs e)
 {
     if (!CanAction)
     {
         return;
     }
     if (!BarcodeTextBox.Focused)
     {
         BarcodeTextBox.Focus();
     }
     //CheckTimer.Enabled = false;
 }
Exemplo n.º 11
0
 public void Clear()
 {
     PCODETextBox.Clear();
     BarcodeTextBox.Clear();
     PDescTextBox.Clear();
     BrandComboBox.Text    = "";
     CategoryComboBox.Text = "";
     PriceTextBox.Clear();
     PCODETextBox.Focus();
     SaveButton.Enabled   = true;
     UpdateButton.Enabled = false;
 }
Exemplo n.º 12
0
        private void Init()
        {
            BarcodeTextBox.Select();
            //BarcodeCatcherTextBox.Width = 0;
            var barCodeController = new BarCodeController(this);

            barCodeController.BarCodeReceived += BarCodeReceived;
            var locA = ManualCheckBox.Location;
            var locB = BarcodeTextBox.Location;

            _shrinkDistance = (locB.Y + BarcodeTextBox.Height) - (locA.Y + ManualCheckBox.Height);
            MakeManualLoginInvisible();
        }
Exemplo n.º 13
0
        private void Init()
        {
            Point             locA, locB;
            BarCodeController barCodeController;

            BarcodeTextBox.Select();
            //BarcodeCatcherTextBox.Width = 0;
            barCodeController = new BarCodeController(this);
            barCodeController.BarCodeReceived += new BarCodeEventHandler(BarCodeReceived);
            locA             = ManualCheckBox.Location;
            locB             = BarcodeTextBox.Location;
            MyShrinkDistance = (locB.Y + BarcodeTextBox.Height) - (locA.Y + ManualCheckBox.Height);
            MakeManualLoginInvisible();
        }
Exemplo n.º 14
0
        /// <summary>
        ///  This event is to get Product info based on Barcode
        ///  and show Product info to the Ordered List
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SubmitBarcodeBtn_Click(object sender, EventArgs e)
        {
            try
            {
                string barcodeFromInput = BarcodeTextBox.Text;

                // Check if ItemBarcode was scanned or customer barcode was scanned

                bool canConvertToNumber = int.TryParse(barcodeFromInput, out int itemBarcode);

                if (canConvertToNumber == true) // is item barcode since item barcode is always a int number
                {
                    ScanProduct(itemBarcode);
                }
                else
                {
                    // is Customer code since customer barcode contain 'C' letter befor number
                    // so that it cannot be parsed to int number
                    CustomerBarcode = barcodeFromInput;
                    Customer customer = new Customer(barcodeFromInput);

                    CurrentOrder.Customer = customer;

                    string customerName   = customer.GetName();
                    int    customerPoints = customer.GetPoints();

                    // display customer name and points to the view
                    CustomerNameLabel.Text   = customerName;
                    CustomerPointsLabel.Text = customerPoints.ToString();
                }

                BarcodeTextBox.Clear();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
                BarcodeTextBox.Text = "";
            }
        }
Exemplo n.º 15
0
        private void HandleSearchResult(string barcodeText)
        {
            if (SearchResult != null)
            {
                SpreadSheetGrid.SelectedItem = SearchResult;
                Dispatcher.CurrentDispatcher.BeginInvoke(
                    DispatcherPriority.Send,
                    new Action(() => SpreadSheetGrid.ScrollIntoView(SearchResult))
                    );

                _totalsBar.TotalFound = _rowList.Where(x => x.Found == true).Count();
                _statusBar.StatusText = barcodeText + " Found!";
            }
            else
            {
                StatusBar.StatusText = barcodeText + " Not Found!";
                //AddScan(barcodeText);
            }

            BarcodeTextBox.Focus();
            BarcodeTextBox.Select(0, BarcodeTextBox.Text.Length);
        }
Exemplo n.º 16
0
        private void BackToScanPackagesButton_Click(object sender, EventArgs e)
        {
            CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Нажата кнопка Назад; CheckPackagesPanel; ScanPackagesPanel.BringToFront()");
            CheckTimer.Enabled = true;
            BarcodeTextBox.Focus();
            ScanPackagesPanel.BringToFront();
            CheckTray.SetTotalLabel(TotalPackCount);
            TotalLabel.Text = CheckTray.LabelInfo.PackedToTotal;

            if (CheckTray.ScanPackgesCount == 0)
            {
                BackToSelectButton.Visible = true;
            }

            CheckPicture.Visible   = true;
            CheckPicture.Image     = Properties.Resources.cancel;
            BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

            BarcodeLabel.Text         = "";
            ClientLabel.Text          = "";
            MegaOrderNumberLabel.Text = "";
            MainOrderNumberLabel.Text = "";
            DispatchDateLabel.Text    = "";
            OrderDateLabel.Text       = "";
            ProductTypeLabel.Text     = "";
            PackNumberLabel.Text      = "";
            GroupLabel.Text           = "";

            FrontsPackContentDataGrid.StateCommon.Background.Color1       = Color.White;
            FrontsPackContentDataGrid.StateCommon.Background.Color2       = Color.Transparent;
            FrontsPackContentDataGrid.StateCommon.DataCell.Back.Color1    = Color.White;
            FrontsPackContentDataGrid.StateCommon.DataCell.Content.Color1 = System.Drawing.Color.Black;

            DecorPackContentDataGrid.StateCommon.Background.Color1       = Color.White;
            DecorPackContentDataGrid.StateCommon.Background.Color2       = Color.Transparent;
            DecorPackContentDataGrid.StateCommon.DataCell.Back.Color1    = Color.White;
            DecorPackContentDataGrid.StateCommon.DataCell.Content.Color1 = System.Drawing.Color.Black;
        }
Exemplo n.º 17
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                BarcodeLabel.Text    = "";
                CheckPicture.Visible = false;

                CheckTray.Clear();

                if (BarcodeTextBox.Text.Length < 12)
                {
                    CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Ошибка: неверный штрихкод " + BarcodeLabel.Text);
                    BarcodeTextBox.Clear();

                    ClientLabel.Text          = string.Empty;
                    MegaOrderNumberLabel.Text = string.Empty;
                    MainOrderNumberLabel.Text = string.Empty;
                    DispatchDateLabel.Text    = string.Empty;
                    OrderDateLabel.Text       = string.Empty;
                    ProductTypeLabel.Text     = string.Empty;
                    PackNumberLabel.Text      = string.Empty;
                    TotalLabel.Text           = string.Empty;
                    GroupLabel.Text           = string.Empty;

                    return;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;

                BarcodeTextBox.Clear();

                bool   BadGroupOrClient = false;
                int    GroupType        = 0;
                int    FactoryID        = 0;
                int    PackageID        = Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9));
                string Prefix           = BarcodeLabel.Text.Substring(0, 3);

                if (Prefix == "001")
                {
                    GroupType = 1;
                    FactoryID = 1;
                }
                if (Prefix == "002")
                {
                    GroupType = 1;
                    FactoryID = 2;
                }
                if (Prefix == "003")
                {
                    GroupType = 2;
                    FactoryID = 1;
                }
                if (Prefix == "004")
                {
                    GroupType = 2;
                    FactoryID = 2;
                }

                CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Сканируется этикетка " + BarcodeLabel.Text);

                #region Проверка на неверный префикс
                if (Prefix != "001" && Prefix != "002" && Prefix != "003" && Prefix != "004")
                {
                    CheckTray.AddEvent(true, -1, -1, -1, -1, string.Empty, string.Empty, "Сканирование упаковки. Неверный префикс штрихкода! Ожидалась этикетка упаковки");
                    ErrorPackLabel.Visible = true;
                    ErrorPackLabel.Text    = "Штрихкод имеет неверный префикс. Допустимые префиксы 001, 002, 003, 004";
                    return;
                }
                #endregion

                #region Находилась ли упаковка на поддоне ранее
                int OldTrayID = CheckTray.IsPackageOnTray(GroupType, PackageID);
                if (OldTrayID > -1)
                {
                    //CheckTray.AddEvent(true, GroupType, FactoryID, -1, PackageID, string.Empty, string.Empty, "Упаковка уже находится на поддоне " + OldTrayID + ". Продолжить?");
                    //bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true,
                    //            "Упаковка уже находится на поддоне " + OldTrayID + ". Всё равно продолжить?", "Внимание");

                    //if (!OKCancel)
                    //{
                    //    CheckTray.AddEvent(false, GroupType, FactoryID, -1, PackageID, string.Empty, string.Empty, "Упаковка уже находится на поддоне " + OldTrayID + ". Задумался");
                    //    CheckPicture.Image = Properties.Resources.cancel;
                    //    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    //    ErrorPackLabel.Text = "Упаковка уже находится на поддоне " + OldTrayID;
                    //    ErrorPackLabel.Visible = true;
                    //    CheckTray.SetGridColor(CheckTray.LabelInfo.ProductType, false);
                    //    return;
                    //}
                    CheckTray.AddEvent(true, GroupType, FactoryID, -1, PackageID, string.Empty, string.Empty, "Упаковка уже находится на поддоне " + OldTrayID + ". Игнорирование!");
                }
                #endregion

                if (CheckTray.CheckPackBarcode(BarcodeLabel.Text))
                {
                    BackToSelectButton.Visible = false;
                    CheckPicture.Visible       = true;
                    CheckTray.GetPackLabelInfo(BarcodeLabel.Text);

                    ClientLabel.Text            = CheckTray.LabelInfo.ClientName;
                    MegaOrderNumberLabel.Text   = CheckTray.LabelInfo.MegaOrderNumber;
                    MainOrderNumberLabel.Text   = CheckTray.LabelInfo.MainOrderNumber;
                    DispatchDateLabel.Text      = CheckTray.LabelInfo.DispatchDate;
                    OrderDateLabel.Text         = CheckTray.LabelInfo.OrderDate;
                    ProductTypeLabel.Text       = CheckTray.LabelInfo.ProductType;
                    PackNumberLabel.Text        = CheckTray.LabelInfo.CurrentPackNumber;
                    DispatchDateLabel.ForeColor = CheckTray.LabelInfo.DispatchDateColor;
                    GroupLabel.Text             = CheckTray.LabelInfo.Group;

                    #region Верная ли группа, ЗОВ или Маркетинг
                    if (GroupType != CheckTray.CurrentGroupType)
                    {
                        BadGroupOrClient = true;
                        CheckTray.AddEvent(true, GroupType, FactoryID, -1, PackageID, string.Empty, string.Empty, "Сканирование упаковки. Неверная группа!");

                        CheckTray.Clear();
                        CheckPicture.Image     = Properties.Resources.cancel;
                        BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                        if (CheckTray.CurrentGroupType == 1)
                        {
                            ErrorPackLabel.Text = "Неверная группа: ожидалась этикетка ЗОВ";
                        }
                        if (CheckTray.CurrentGroupType == 2)
                        {
                            ErrorPackLabel.Text = "Неверная группа: ожидалась этикетка Маркетинг";
                        }
                        ErrorPackLabel.Visible = true;
                        CheckTray.SetGridColor(CheckTray.LabelInfo.ProductType, false);
                        //return;
                    }
                    #endregion

                    #region Если группа Маркетинг, то проверить соответствие клиента
                    if (GroupType == CheckTray.CurrentGroupType && CheckTray.CurrentGroupType == 2 &&
                        CheckTray.IsWrongClient(Convert.ToInt32(CheckTray.LabelInfo.MainOrderNumber)))
                    {
                        BadGroupOrClient = true;
                        CheckTray.AddEvent(true, GroupType, FactoryID, -1, PackageID, string.Empty, string.Empty, "Сканирование упаковки. Неверный клиент!");

                        CheckPicture.Image     = Properties.Resources.cancel;
                        BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                        ErrorPackLabel.Text    = "Неверный клиент: ожидался клиент " + CheckTray.CurrentClientName;
                        ErrorPackLabel.Visible = true;
                        CheckTray.SetGridColor(CheckTray.LabelInfo.ProductType, false);
                        //return;
                    }
                    #endregion

                    //if (!BadGroupOrClient)
                    //{
                    //    if (CheckTray.IsNotPacked(GroupType, PackageID))
                    //    {
                    //        CheckTray.SetPacked(GroupType, PackageID);

                    //    }

                    //    if (CheckTray.CurrentGroupType == 2)
                    //    {
                    //        int MainOrderID = CheckTray.GetMainOrderID(GroupType, PackageID);
                    //        int MegaOrderID = CheckTray.GetMegaOrderID(MainOrderID);
                    //        if (CheckTray.LabelInfo.MainOrderID > 0)
                    //        {
                    //            CheckOrdersStatus.SetMainOrderStatus(true, CheckTray.LabelInfo.MainOrderID, false);
                    //            CheckOrdersStatus.SetMegaOrderStatus(CheckTray.LabelInfo.MegaOrderID);
                    //        }
                    //    }
                    //}

                    CheckTray.AddToTray(GroupType, FactoryID, PackageID);
                    CheckTray.SetTotalLabel(TotalPackCount);
                    TotalLabel.Text      = CheckTray.LabelInfo.PackedToTotal;
                    TotalLabel.ForeColor = CheckTray.LabelInfo.TotalLabelColor;

                    string PackageInfo = CheckTray.SetPackageInfo(
                        CheckTray.LabelInfo.ClientID,
                        CheckTray.LabelInfo.MegaOrderID,
                        CheckTray.LabelInfo.MainOrderID,
                        CheckTray.LabelInfo.Dispatch,
                        CheckTray.LabelInfo.DocDateTime,
                        CheckTray.LabelInfo.Product);

                    if (!BadGroupOrClient)
                    {
                        CheckTray.AddEvent(false, GroupType, FactoryID, -1, PackageID, PackageInfo, string.Empty, "Упаковка добавлена на поддон");
                        CheckPicture.Image     = Properties.Resources.OK;
                        BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                        ErrorPackLabel.Visible = false;
                        CheckTray.SetGridColor(CheckTray.LabelInfo.ProductType, true);
                    }
                    else
                    {
                        CheckTray.AddEvent(true, GroupType, FactoryID, -1, PackageID, string.Empty, string.Empty, "Снять с поддона!");
                    }
                }
                else
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    ErrorPackLabel.Text    = "Такой этикетки не существует в базе";
                    ErrorPackLabel.Visible = true;

                    ClientLabel.Text          = string.Empty;
                    MegaOrderNumberLabel.Text = string.Empty;
                    MainOrderNumberLabel.Text = string.Empty;
                    DispatchDateLabel.Text    = string.Empty;
                    OrderDateLabel.Text       = string.Empty;
                    ProductTypeLabel.Text     = string.Empty;
                    PackNumberLabel.Text      = string.Empty;
                    TotalLabel.Text           = string.Empty;
                    GroupLabel.Text           = string.Empty;

                    CheckTray.SetGridColor(CheckTray.LabelInfo.ProductType, false);
                }
            }
        }
Exemplo n.º 18
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                sw.Start();

                BarcodeLabel.Text    = "";
                CheckPicture.Visible = false;

                BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

                ClearControls();

                if (BarcodeTextBox.Text.Length < 12)
                {
                    BarcodeTextBox.Clear();
                    BarcodeLabel.Text      = "Неверный штрихкод";
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    return;
                }

                string Prefix = BarcodeTextBox.Text.Substring(0, 3);

                if (Prefix != "021")
                {
                    BarcodeTextBox.Clear();
                    BarcodeLabel.Text      = "Это не штрихкод упаковки";
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    return;
                }

                int CabFurniturePackageID = Convert.ToInt32(BarcodeTextBox.Text.Substring(3, 9));

                if (!storagePackagesManager.IsPackageExist(CabFurniturePackageID))
                {
                    CabFurniturePackageID = -1;
                    BarcodeTextBox.Clear();
                    BarcodeLabel.Text      = "Упаковки не существует";
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    return;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;
                BarcodeTextBox.Clear();

                if (storagePackagesManager.GetBindPackagesLabels(CabFurniturePackageID))
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.OK;
                    BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                }
                else
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

                    BarcodeLabel.Text = "Упаковки не существует";
                    ClearControls();
                }
            }
        }
Exemplo n.º 19
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            double G = 0;

            if (e.KeyCode == Keys.Enter)
            {
                System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                sw.Start();

                BarcodeLabel.Text    = string.Empty;
                CheckPicture.Visible = false;

                CheckLabel.Clear();

                if (BarcodeTextBox.Text.Length < 12)
                {
                    BarcodeTextBox.Clear();

                    lbMegaBatch.Text      = string.Empty;
                    lbUserName.Text       = string.Empty;
                    lbWeekNumber.Text     = string.Empty;
                    lbNumberOfChange.Text = string.Empty;
                    lbPalleteNumber.Text  = string.Empty;
                    lbDocDateTime.Text    = string.Empty;
                    lbFactory.Text        = string.Empty;
                    lbGroup.Text          = string.Empty;

                    return;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;

                BarcodeTextBox.Clear();

                int PalleteID = Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9));

                if (CheckLabel.CheckBarcode(BarcodeLabel.Text))
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.OK;
                    BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                    CheckLabel.GetPalleteParameters(BarcodeLabel.Text);
                    CheckLabel.FillDecorPackContent(BarcodeLabel.Text);
                    if (TypeAction == PalleteTypeAction.PackingPallete)
                    {
                        CheckLabel.SetPacked(BarcodeLabel.Text);
                    }
                    if (TypeAction == PalleteTypeAction.DispatchPallete)
                    {
                        CheckLabel.SetDispatched(BarcodeLabel.Text);
                    }

                    lbMegaBatch.Text      = CheckLabel.LabelInfo.MegaBatchID.ToString();
                    lbNumberOfChange.Text = CheckLabel.LabelInfo.NumberOfChange.ToString();
                    lbPalleteNumber.Text  = PalleteID.ToString();
                    lbUserName.Text       = CheckLabel.LabelInfo.UserName;
                    lbWeekNumber.Text     = CheckLabel.LabelInfo.WeekNumber.ToString();
                    lbDocDateTime.Text    = CheckLabel.LabelInfo.DocDateTime;
                    if (CheckLabel.LabelInfo.FactoryType == 1)
                    {
                        lbFactory.Text = "ЗОВ-Профиль";
                    }
                    if (CheckLabel.LabelInfo.FactoryType == 2)
                    {
                        lbFactory.Text = "ЗОВ-ТПС";
                    }
                    lbGroup.Text = CheckLabel.LabelInfo.GroupType;
                }
                else
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

                    lbMegaBatch.Text      = string.Empty;
                    lbUserName.Text       = string.Empty;
                    lbWeekNumber.Text     = string.Empty;
                    lbNumberOfChange.Text = string.Empty;
                    lbPalleteNumber.Text  = string.Empty;
                    lbDocDateTime.Text    = string.Empty;
                    lbFactory.Text        = string.Empty;
                    lbGroup.Text          = string.Empty;
                }

                sw.Stop();
                G = sw.Elapsed.TotalMilliseconds;
            }
        }
Exemplo n.º 20
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (!CanAction)
            {
                return;
            }
            double G = 0;

            if (e.KeyCode == Keys.Enter)
            {
                System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                sw.Start();

                BarcodeLabel.Text    = "";
                CheckPicture.Visible = false;

                CheckLabel.Clear();

                if (BarcodeTextBox.Text.Length < 12)
                {
                    BarcodeTextBox.Clear();

                    ClientLabel.Text          = "";
                    MegaOrderNumberLabel.Text = "";
                    MainOrderNumberLabel.Text = "";
                    DispatchDateLabel.Text    = "";
                    OrderDateLabel.Text       = "";
                    ProductTypeLabel.Text     = "";
                    PackNumberLabel.Text      = "";
                    TotalLabel.Text           = "";
                    GroupLabel.Text           = "";

                    return;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;

                BarcodeTextBox.Clear();


                if (CheckLabel.CheckBarcode(BarcodeLabel.Text))
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.OK;
                    BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                    CheckLabel.GetLabelInfo(BarcodeLabel.Text);

                    ClientLabel.Text            = CheckLabel.LabelInfo.ClientName;
                    MegaOrderNumberLabel.Text   = CheckLabel.LabelInfo.MegaOrderNumber;
                    MainOrderNumberLabel.Text   = CheckLabel.LabelInfo.MainOrderNumber;
                    DispatchDateLabel.Text      = CheckLabel.LabelInfo.DispatchDate;
                    OrderDateLabel.Text         = CheckLabel.LabelInfo.OrderDate;
                    ProductTypeLabel.Text       = CheckLabel.LabelInfo.ProductType;
                    PackNumberLabel.Text        = CheckLabel.LabelInfo.CurrentPackNumber;
                    TotalLabel.Text             = CheckLabel.LabelInfo.PackedToTotal;
                    DispatchDateLabel.ForeColor = CheckLabel.LabelInfo.DispatchDateColor;
                    TotalLabel.ForeColor        = CheckLabel.LabelInfo.TotalLabelColor;
                    GroupLabel.Text             = CheckLabel.LabelInfo.Group;

                    CheckLabel.SetGridColor(CheckLabel.LabelInfo.ProductType, true);

                    if (CheckLabel.LabelInfo.Group == "Маркетинг")
                    {
                        //CheckLabel.SetMainOrderStatus(BarcodeLabel.Text, Convert.ToInt32(CheckLabel.LabelInfo.MainOrderNumber));
                        CheckOrdersStatus.SetStatusMarketingForMainOrder(Convert.ToInt32(CheckLabel.LabelInfo.MegaOrderID),
                                                                         Convert.ToInt32(CheckLabel.LabelInfo.MainOrderID));
                    }
                    if (CheckLabel.LabelInfo.Group == "ЗОВ")
                    {
                        //CheckLabel.SetMainOrderStatus(BarcodeLabel.Text, Convert.ToInt32(CheckLabel.LabelInfo.MainOrderNumber));
                        CheckOrdersStatus.SetStatusZOV(CheckLabel.LabelInfo.MainOrderID, false);
                    }
                }
                else
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

                    ClientLabel.Text          = "";
                    MegaOrderNumberLabel.Text = "";
                    MainOrderNumberLabel.Text = "";
                    DispatchDateLabel.Text    = "";
                    OrderDateLabel.Text       = "";
                    ProductTypeLabel.Text     = "";
                    PackNumberLabel.Text      = "";
                    TotalLabel.Text           = "";
                    GroupLabel.Text           = "";

                    CheckLabel.SetGridColor(CheckLabel.LabelInfo.ProductType, false);
                }

                sw.Stop();
                G = sw.Elapsed.TotalMilliseconds;
                //MessageBox.Show(G.ToString());
            }
        }
Exemplo n.º 21
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (!CanAction)
            {
                return;
            }

            if (e.KeyCode == Keys.Enter)
            {
                System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                sw.Start();

                BarcodeLabel.Text    = "";
                CheckPicture.Visible = false;

                BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

                if (BarcodeTextBox.Text.Length < 12)
                {
                    BarcodeTextBox.Clear();
                    BarcodeLabel.Text      = "Неверный штрихкод";
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    return;
                }

                string Prefix = BarcodeTextBox.Text.Substring(0, 3);

                if (Prefix != "021")
                {
                    BarcodeTextBox.Clear();
                    BarcodeLabel.Text      = "Это не штрихкод упаковки";
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    return;
                }

                int CabFurniturePackageID = Convert.ToInt32(BarcodeTextBox.Text.Substring(3, 9));

                if (assemblePackagesManager.IsPackageScan(CabFurniturePackageID))
                {
                    CabFurniturePackageID = -1;
                    BarcodeTextBox.Clear();
                    BarcodeLabel.Text      = "Уже отсканировано";
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    return;
                }
                if (!assemblePackagesManager.IsPackageExist(CabFurniturePackageID))
                {
                    CabFurniturePackageID = -1;
                    BarcodeTextBox.Clear();
                    BarcodeLabel.Text      = "Упаковки не существует";
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    return;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;
                BarcodeTextBox.Clear();

                if (assemblePackagesManager.ScanPackage(CabFurniturePackageID))
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.OK;
                    BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                }
                else
                {
                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

                    BarcodeLabel.Text = "Упаковки не соответствует заказу";
                }
                lbScaned.Text   = assemblePackagesManager.ScanedPackages;
                lbRackName.Text = assemblePackagesManager.RackName;
                lbCellName.Text = assemblePackagesManager.CellName;
            }
        }
Exemplo n.º 22
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (!CanAction)
            {
                return;
            }
            if (e.KeyCode == Keys.Enter)
            {
                ErrorPackLabel.Visible = false;
                BarcodeLabel.Text      = "";
                CheckPicture.Visible   = false;

                CheckLabel.Clear();

                if (BarcodeTextBox.Text.Length < 12)
                {
                    BarcodeTextBox.Clear();
                    OrderDateLabel.Text  = "";
                    GroupLabel.Text      = "";
                    lblPackageCount.Text = string.Empty;
                    return;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;

                BarcodeTextBox.Clear();

                string Message = string.Empty;
                string Prefix  = BarcodeLabel.Text.Substring(0, 3);

                if (CheckLabel.IsPackageLabel(BarcodeLabel.Text))
                {
                    int PackageID = Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9));
                    if (CheckLabel.HasPackages(BarcodeLabel.Text))
                    {
                        CheckLabel.GetPackageInfo(PackageID);
                        CheckLabel.FillPackagesByPackage(BarcodeLabel.Text);
                        CheckLabel.AddPackageToTempTable();

                        CheckPicture.Visible   = true;
                        CheckPicture.Image     = Properties.Resources.OK;
                        BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                        GroupLabel.Text        = CheckLabel.LabelInfo.Group;
                        lblPackageCount.Text   = CheckLabel.LabelInfo.PackageCount.ToString();
                        OrderDateLabel.Text    = CheckLabel.LabelInfo.OrderDate;
                    }
                    else
                    {
                        CheckPicture.Visible   = true;
                        CheckPicture.Image     = Properties.Resources.cancel;
                        BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                        GroupLabel.Text        = "";
                        lblPackageCount.Text   = string.Empty;
                        OrderDateLabel.Text    = "";
                    }
                }
                else
                {
                    if (CheckLabel.IsTrayLabel(BarcodeLabel.Text))
                    {
                        int TrayID = Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9));

                        //CheckOrdersStatus.SetStatusZOV(TrayID, true);
                        //CheckOrdersStatus.SetStatusMarketingForTray(TrayID);
                        if (CheckLabel.HasTray(BarcodeLabel.Text))
                        {
                            CheckLabel.FillPackagesByTray(BarcodeLabel.Text);
                            CheckLabel.AddPackageToTempTable();
                            CheckLabel.AddTrayToTempTable(TrayID);

                            CheckPicture.Visible   = true;
                            CheckPicture.Image     = Properties.Resources.OK;
                            BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                            GroupLabel.Text        = CheckLabel.LabelInfo.Group;
                            lblPackageCount.Text   = CheckLabel.LabelInfo.PackageCount.ToString();
                            OrderDateLabel.Text    = CheckLabel.LabelInfo.OrderDate;
                        }
                        else
                        {
                            CheckPicture.Visible   = true;
                            CheckPicture.Image     = Properties.Resources.cancel;
                            BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                            GroupLabel.Text        = "";
                            lblPackageCount.Text   = string.Empty;
                            OrderDateLabel.Text    = "";
                        }
                    }
                    else
                    {
                        CheckPicture.Visible   = true;
                        CheckPicture.Image     = Properties.Resources.cancel;
                        BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                        OrderDateLabel.Text    = "";
                        lblPackageCount.Text   = string.Empty;
                        GroupLabel.Text        = "";
                        CheckLabel.Clear();
                        return;
                    }
                }
            }
        }
Exemplo n.º 23
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (!CanAction)
            {
                return;
            }
            if (e.KeyCode == Keys.Enter)
            {
                BarcodeLabel.Text    = "";
                CheckPicture.Visible = false;

                CheckLabel.Clear();

                if (BarcodeTextBox.Text.Length < 12)
                {
                    ScanEvents.AddEvent(EventsDataTable, "Ошибка: неверный штрихкод " + BarcodeLabel.Text, 0, CheckLabel.UserID);
                    BarcodeTextBox.Clear();

                    ClientLabel.Text          = "";
                    MegaOrderNumberLabel.Text = "";
                    MainOrderNumberLabel.Text = "";
                    DispatchDateLabel.Text    = "";
                    OrderDateLabel.Text       = "";
                    ProductTypeLabel.Text     = "";
                    PackNumberLabel.Text      = "";
                    TotalLabel.Text           = "";
                    GroupLabel.Text           = "";

                    return;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;

                BarcodeTextBox.Clear();

                string Prefix = BarcodeLabel.Text.Substring(0, 3);

                ScanEvents.AddEvent(EventsDataTable, "Сканируется этикетка " + BarcodeLabel.Text, 0, CheckLabel.UserID);

                if (CheckLabel.CheckBarcode(BarcodeLabel.Text))
                {
                    if (Prefix == "001")
                    {
                        ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                                            ", пр-во ЗОВ-Профиль, отгрузка ЗОВ", 1, CheckLabel.UserID);
                    }
                    if (Prefix == "002")
                    {
                        ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                                            ", пр-во ЗОВ-ТПС, отгрузка ЗОВ", 1, CheckLabel.UserID);
                    }
                    if (Prefix == "003")
                    {
                        ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                                            ", пр-во ЗОВ-Профиль, отгрузка Маркетинг", 2, CheckLabel.UserID);
                    }
                    if (Prefix == "004")
                    {
                        ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                                            ", пр-во ЗОВ-ТПС, отгрузка Маркетинг", 2, CheckLabel.UserID);
                    }

                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.OK;
                    BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                    CheckLabel.GetLabelInfo(ref EventsDataTable, BarcodeLabel.Text);

                    ClientLabel.Text            = CheckLabel.LabelInfo.ClientName;
                    MegaOrderNumberLabel.Text   = CheckLabel.LabelInfo.MegaOrderNumber;
                    MainOrderNumberLabel.Text   = CheckLabel.LabelInfo.MainOrderNumber;
                    DispatchDateLabel.Text      = CheckLabel.LabelInfo.DispatchDate;
                    OrderDateLabel.Text         = CheckLabel.LabelInfo.OrderDate;
                    ProductTypeLabel.Text       = CheckLabel.LabelInfo.ProductType;
                    PackNumberLabel.Text        = CheckLabel.LabelInfo.CurrentPackNumber;
                    TotalLabel.Text             = CheckLabel.LabelInfo.PackedToTotal;
                    DispatchDateLabel.ForeColor = CheckLabel.LabelInfo.DispatchDateColor;
                    TotalLabel.ForeColor        = CheckLabel.LabelInfo.TotalLabelColor;
                    GroupLabel.Text             = CheckLabel.LabelInfo.Group;

                    CheckLabel.SetGridColor(CheckLabel.LabelInfo.ProductType, true);

                    if (CheckLabel.LabelInfo.Group == "Маркетинг")
                    {
                        CheckOrdersStatus.SetStatusMarketingForMainOrder(Convert.ToInt32(CheckLabel.LabelInfo.MegaOrderID), CheckLabel.LabelInfo.MainOrderID);
                        ScanEvents.AddEvent(EventsDataTable, "Выставлен статус для подзаказа №" + CheckLabel.LabelInfo.MainOrderID, 2, CheckLabel.UserID);
                    }
                    if (CheckLabel.LabelInfo.Group == "ЗОВ")
                    {
                        CheckOrdersStatus.SetStatusZOV(CheckLabel.LabelInfo.MainOrderID, false);
                        ScanEvents.AddEvent(EventsDataTable, "Выставлен статус для подзаказа №" + CheckLabel.LabelInfo.MainOrderID, 1, CheckLabel.UserID);
                    }
                }
                else
                {
                    ScanEvents.AddEvent(EventsDataTable, "Ошибка: в таблице Packages нет упаковки с номером №" + BarcodeLabel.Text, 0, CheckLabel.UserID);

                    CheckPicture.Visible   = true;
                    CheckPicture.Image     = Properties.Resources.cancel;
                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);

                    ClientLabel.Text          = "";
                    MegaOrderNumberLabel.Text = "";
                    MainOrderNumberLabel.Text = "";
                    DispatchDateLabel.Text    = "";
                    OrderDateLabel.Text       = "";
                    ProductTypeLabel.Text     = "";
                    PackNumberLabel.Text      = "";
                    TotalLabel.Text           = "";
                    GroupLabel.Text           = "";

                    CheckLabel.SetGridColor(CheckLabel.LabelInfo.ProductType, false);
                }
            }
        }
Exemplo n.º 24
0
        private void ChangeTrayBracodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                ChangeTrayBracodeLabel.Text = "";
                pictureBox1.Visible         = false;

                CheckTray.Clear();

                if (ChangeTrayBracodeTextBox.Text.Length < 12)
                {
                    CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Ошибка: неверный штрихкод " + ChangeTrayBracodeTextBox.Text);
                    ChangeTrayBracodeTextBox.Clear();
                    return;
                }

                ChangeTrayBracodeLabel.Text = ChangeTrayBracodeTextBox.Text;

                ChangeTrayBracodeTextBox.Clear();

                int    TrayID = Convert.ToInt32(ChangeTrayBracodeLabel.Text.Substring(3, 9));
                string Prefix = ChangeTrayBracodeLabel.Text.Substring(0, 3);

                if (Prefix != "005" && Prefix != "006")
                {
                    CheckTray.AddEvent(true, -1, -1, TrayID, -1, string.Empty, string.Empty, "Сканирование поддона. Неверный префикс штрихкода! Ожидалась этикетка поддона");
                    label17.Visible = true;
                    label17.Text    = "Штрихкод имеет неверный префикс. Допустимые префиксы 005 и 006";
                }

                CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Добавление на поддон");
                CheckTray.AddEvent(false, -1, -1, -1, -1, string.Empty, string.Empty, "Сканируется этикетка " + ChangeTrayBracodeLabel.Text);

                if (Prefix == "005")
                {
                    CheckTray.CurrentGroupType = 1;
                }
                if (Prefix == "006")
                {
                    CheckTray.CurrentGroupType = 2;
                }

                if (CheckTray.CheckTrayBarcode(ChangeTrayBracodeLabel.Text))
                {
                    CheckTray.IsNewTray     = false;
                    CheckTray.CurrentTrayID = TrayID;

                    if (CheckTray.CurrentGroupType == 2)
                    {
                        CheckTray.GetClientID(TrayID);
                        CheckTray.CurrentClientName = CheckTray.GetMarketClientName(CheckTray.CurrentClientID);
                        CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, TrayID, -1, string.Empty, string.Empty,
                                           "Поддон под клиентом: " + CheckTray.CurrentClientName);
                    }

                    CheckTray.AddEvent(false, CheckTray.CurrentGroupType, -1, TrayID, -1, string.Empty, string.Empty,
                                       "Поддон успешно отсканирован; ScanPackagesPanel.BringToFront()");

                    ScanPackagesPanel.BringToFront();
                    ChangeTrayBracodeLabel.Text = "";
                    CheckTimer.Enabled          = true;
                    BarcodeTextBox.Focus();
                }
                else
                {
                    pictureBox1.Visible = true;
                    pictureBox1.Image   = Properties.Resources.cancel;
                    ChangeTrayBracodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    label17.Text    = "Такой этикетки не существует в базе";
                    label17.Visible = true;
                    CheckTray.Clear();
                    return;
                }
            }
        }
Exemplo n.º 25
0
 private void NavigateMenuCloseButton_MouseUp(object sender, MouseEventArgs e)
 {
     BarcodeTextBox.Focus();
 }
Exemplo n.º 26
0
 private void SaveButton_MouseUp(object sender, MouseEventArgs e)
 {
     BarcodeTextBox.Focus();
 }
 private void BarcodeInventoryCommit_OnClick(object sender, RoutedEventArgs e)
 {
     InventoryItemFromBarcode();
     BarcodeTextBox.Clear();
 }
Exemplo n.º 28
0
        private void BarcodeTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (!CanAction)
            {
                return;
            }
            if (e.KeyCode == Keys.Enter)
            {
                ErrorPackLabel.Visible = false;
                BarcodeLabel.Text      = "";
                CheckPicture.Visible   = false;

                CheckLabel.Clear();

                if (BarcodeTextBox.Text.Length < 12)
                {
                    //ScanEvents.AddEvent(EventsDataTable, "Ошибка: неверный штрихкод " + BarcodeLabel.Text, 0);
                    BarcodeTextBox.Clear();
                    OrderDateLabel.Text = "";
                    GroupLabel.Text     = "";
                    bClearNextPackage   = false;
                    return;
                }

                if (bClearNextPackage)
                {
                    int TrayID = 0;
                    CheckLabel.RemovePackageFromTray(Convert.ToInt32(BarcodeTextBox.Text.Substring(3, 9)), ref TrayID);
                    ErrorPackLabel.Visible = true;
                    ErrorPackLabel.Text    = "Упаковка №" + Convert.ToInt32(BarcodeTextBox.Text.Substring(3, 9)) + " убрана с поддона №" + TrayID;
                    bClearNextPackage      = false;
                    BarcodeTextBox.Clear();

                    return;
                }

                if (string.Equals(BarcodeTextBox.Text, "000000000000"))
                {
                    ErrorPackLabel.Visible = true;
                    ErrorPackLabel.Text    = "Следующая отсканированная упаковка будет убрана с поддона";
                    bClearNextPackage      = true;
                    BarcodeTextBox.Clear();

                    return;
                }
                else
                {
                    bClearNextPackage = false;
                }

                BarcodeLabel.Text = BarcodeTextBox.Text;

                BarcodeTextBox.Clear();

                string Prefix = BarcodeLabel.Text.Substring(0, 3);

                //ScanEvents.AddEvent(EventsDataTable, "Сканируется этикетка " + BarcodeLabel.Text, 0);

                if (CheckLabel.IsPackageLabel(BarcodeLabel.Text))
                {
                    //if (Prefix == "001")
                    //{
                    //    ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                    //        ", пр-во ЗОВ-Профиль, экспедиция ЗОВ", 1);
                    //}
                    //if (Prefix == "002")
                    //{
                    //    ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                    //        ", пр-во ЗОВ-ТПС, экспедиция ЗОВ", 1);
                    //}
                    //if (Prefix == "003")
                    //{
                    //    ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                    //        ", пр-во ЗОВ-Профиль, экспедиция Маркетинг", 2);
                    //}
                    //if (Prefix == "004")
                    //{
                    //    ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка упаковки №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                    //        ", пр-во ЗОВ-ТПС, экспедиция Маркетинг", 2);
                    //}
                    int PackageID = Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9));
                    if (CheckLabel.HasPackages(BarcodeLabel.Text))
                    {
                        string Message = string.Empty;
                        CheckLabel.GetPackageInfo(PackageID);
                        if (Prefix == "001" || Prefix == "002")
                        {
                            //CheckLabel.SetExp(ref EventsDataTable, false, PackageID, ref Message);
                            ////int DebtMainOrderID = CheckLabel.GetDebtMainOrderID(CheckLabel.CurrentMainOrderID);
                            ////if (DebtMainOrderID != -1)
                            ////    CheckLabel.SetExpDebt(DebtMainOrderID);
                            //CheckOrdersStatus.SetStatusZOV(CheckLabel.CurrentMainOrderID, false);
                            //ScanEvents.AddEvent(EventsDataTable, "Выставлен статус для подзаказа №" + CheckLabel.CurrentMainOrderID +
                            //    ", экспедиция ЗОВ", 1);


                            if (CheckLabel.CanPackageExp(PackageID, ref Message))
                            {
                                if (!CheckLabel.SetExp(ref EventsDataTable, false, PackageID, ref Message))
                                {
                                    ErrorPackLabel.Visible = true;
                                    ErrorPackLabel.Text    = Message;
                                    CheckPicture.Visible   = true;
                                    CheckPicture.Image     = Properties.Resources.cancel;
                                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                                    GroupLabel.Text        = "";
                                    OrderDateLabel.Text    = "";
                                    return;
                                }
                                if (Message.Length > 0)
                                {
                                    ErrorPackLabel.Visible = true;
                                    ErrorPackLabel.Text    = Message;
                                }

                                CheckOrdersStatus.SetStatusZOV(CheckLabel.CurrentMainOrderID, false);
                                //ScanEvents.AddEvent(EventsDataTable, "Выставлен статус для подзаказа №" + CheckLabel.CurrentMainOrderID +
                                //    ", экспедиция ЗОВ", 1);
                            }
                            else
                            {
                                ErrorPackLabel.Visible = true;
                                ErrorPackLabel.Text    = Message;
                                CheckPicture.Visible   = true;
                                CheckPicture.Image     = Properties.Resources.cancel;
                                BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                                GroupLabel.Text        = "";
                                OrderDateLabel.Text    = "";
                                //ScanEvents.AddEvent(EventsDataTable,
                                //    "Упаковка №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) + " не принята на эксп-цию: запрет на эксп-цию, экспедиция Маркетинг", 2);
                                return;
                            }
                        }

                        if (Prefix == "003" || Prefix == "004")
                        {
                            if (CheckLabel.CanPackageExp(PackageID, ref Message))
                            {
                                if (!CheckLabel.SetExp(ref EventsDataTable, true, PackageID, ref Message))
                                {
                                    ErrorPackLabel.Visible = true;
                                    ErrorPackLabel.Text    = Message;
                                    CheckPicture.Visible   = true;
                                    CheckPicture.Image     = Properties.Resources.cancel;
                                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                                    GroupLabel.Text        = "";
                                    OrderDateLabel.Text    = "";
                                    return;
                                }
                                if (Message.Length > 0)
                                {
                                    ErrorPackLabel.Visible = true;
                                    ErrorPackLabel.Text    = Message;
                                }

                                CheckLabel.WriteOffFromStore(PackageID);
                                CheckOrdersStatus.SetStatusMarketingForMainOrder(CheckLabel.CurrentMegaOrderID, CheckLabel.CurrentMainOrderID);
                                //ScanEvents.AddEvent(EventsDataTable, "Выставлен статус для подзаказа №" + CheckLabel.CurrentMainOrderID +
                                //    ", экспедиция Маркетинг", 2);
                            }
                            else
                            {
                                ErrorPackLabel.Visible = true;
                                ErrorPackLabel.Text    = Message;
                                CheckPicture.Visible   = true;
                                CheckPicture.Image     = Properties.Resources.cancel;
                                BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                                GroupLabel.Text        = "";
                                OrderDateLabel.Text    = "";
                                //ScanEvents.AddEvent(EventsDataTable,
                                //    "Упаковка №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) + " не принята на эксп-цию: запрет на эксп-цию, экспедиция Маркетинг", 2);
                                return;
                            }
                        }
                        CheckLabel.FilterByPackageID(BarcodeLabel.Text);

                        CheckPicture.Visible   = true;
                        CheckPicture.Image     = Properties.Resources.OK;
                        BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                        GroupLabel.Text        = CheckLabel.LabelInfo.Group;
                        OrderDateLabel.Text    = CheckLabel.LabelInfo.OrderDate;
                    }
                    else
                    {
                        CheckPicture.Visible   = true;
                        CheckPicture.Image     = Properties.Resources.cancel;
                        BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                        GroupLabel.Text        = "";
                        OrderDateLabel.Text    = "";
                    }
                }
                else
                {
                    //if (Prefix == "005" || Prefix == "006")
                    //{
                    //    ErrorPackLabel.Visible = true;
                    //    ErrorPackLabel.Text = "На экспедицию принимаются только упаковки поштучно";
                    //    CheckPicture.Visible = true;
                    //    CheckPicture.Image = Properties.Resources.cancel;
                    //    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    //    OrderDateLabel.Text = "";
                    //    GroupLabel.Text = "";
                    //    CheckLabel.Clear();
                    //    return;
                    //}
                    //ErrorPackLabel.Visible = true;
                    //ErrorPackLabel.Text = "Такой этикетки в упаковках не существует";
                    //CheckPicture.Visible = true;
                    //CheckPicture.Image = Properties.Resources.cancel;
                    //BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                    //OrderDateLabel.Text = "";
                    //GroupLabel.Text = "";
                    //CheckLabel.Clear();
                    //return;
                    if (CheckLabel.IsTrayLabel(BarcodeLabel.Text))
                    {
                        //if (Prefix == "005")
                        //{
                        //    ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка поддона №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                        //        ", экспедиция ЗОВ", 1);
                        //}
                        //if (Prefix == "006")
                        //{
                        //    ScanEvents.AddEvent(EventsDataTable, "Отсканировано: этикетка поддона №" + Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)) +
                        //        ", экспедиция Маркетинг", 2);
                        //}

                        if (CheckLabel.HasTray(BarcodeLabel.Text))
                        {
                            if (Prefix == "005")
                            {
                                CheckLabel.SetExp(BarcodeLabel.Text);
                                CheckOrdersStatus.SetStatusZOV(Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)), true);
                            }

                            if (Prefix == "006")
                            {
                                string Message = string.Empty;

                                if (CheckLabel.CanTrayExp(Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)), ref Message))
                                {
                                    CheckLabel.SetExp(BarcodeLabel.Text);
                                    if (Message.Length > 0)
                                    {
                                        ErrorPackLabel.Visible = true;
                                        ErrorPackLabel.Text    = Message;
                                    }
                                    CheckOrdersStatus.SetStatusMarketingForTray(Convert.ToInt32(BarcodeLabel.Text.Substring(3, 9)));
                                }
                                else
                                {
                                    ErrorPackLabel.Visible = true;
                                    ErrorPackLabel.Text    = Message;
                                    CheckPicture.Visible   = true;
                                    CheckPicture.Image     = Properties.Resources.cancel;
                                    BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                                    OrderDateLabel.Text    = "";
                                    GroupLabel.Text        = "";
                                    CheckLabel.Clear();
                                    return;
                                }
                            }
                            CheckLabel.FillPackages(BarcodeLabel.Text);

                            CheckPicture.Visible   = true;
                            CheckPicture.Image     = Properties.Resources.OK;
                            BarcodeLabel.ForeColor = Color.FromArgb(82, 169, 24);
                            GroupLabel.Text        = CheckLabel.LabelInfo.Group;
                            OrderDateLabel.Text    = CheckLabel.LabelInfo.OrderDate;
                        }
                        else
                        {
                            //ScanEvents.AddEvent(EventsDataTable, "Ошибка: в таблице Packages нет упаковок с номером поддона №" + BarcodeLabel.Text, 0);
                            CheckPicture.Visible   = true;
                            CheckPicture.Image     = Properties.Resources.cancel;
                            BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                            GroupLabel.Text        = "";
                            OrderDateLabel.Text    = "";
                        }
                    }
                    else
                    {
                        //ScanEvents.AddEvent(EventsDataTable, "Ошибка: в таблице Trays нет записей с номером поддона №" + BarcodeLabel.Text, 0);
                        CheckPicture.Visible   = true;
                        CheckPicture.Image     = Properties.Resources.cancel;
                        BarcodeLabel.ForeColor = Color.FromArgb(240, 0, 0);
                        OrderDateLabel.Text    = "";
                        GroupLabel.Text        = "";
                        CheckLabel.Clear();
                        return;
                    }
                }
            }
        }