示例#1
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()");
        }
示例#2
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;
        }
示例#3
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;
                }
            }
        }