Пример #1
0
 private void textBoxRankBQr_KeyDown_1(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Return)
     {
         currentLedReel = SqlOperations.GetLedDataFromSparing(textBoxRankBQr.Text.ToUpper());
         if (currentLedReel.ID != "error")
         {
             dataGridViewRankB.Rows.Add(currentLedReel.NC12, currentLedReel.ID, currentLedReel.Rank, currentLedReel.Ilosc, currentLedReel.ZlecenieString);
             CheckIfCorrectLed();
             foreach (DataGridViewColumn col in dataGridViewRankB.Columns)
             {
                 col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
             }
             textBoxRankBQr.Text = "";
             textBoxRankAQr.Focus();
             labelRankBLoaded.Text += Environment.NewLine + currentLedReel.Rank;
             CountQtyProductToManufacture();
             CheckIfFormDataComplete();
         }
     }
 }
Пример #2
0
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                if (textBoxRankAQr.Text.Split('\t').Length > 5)
                {
                    currentLedReel = SqlOperations.GetLedDataFromSparing(textBoxRankAQr.Text.ToUpper());
                    if (currentLedReel.ID != "error")
                    {
                        dataGridViewRankA.Rows.Add(currentLedReel.NC12, currentLedReel.ID, currentLedReel.Rank, currentLedReel.Ilosc, currentLedReel.ZlecenieString);

                        foreach (DataGridViewColumn col in dataGridViewRankA.Columns)
                        {
                            col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                        }
                        textBoxRankAQr.Text = "";
                        CheckIfCorrectLed();
                        textBoxRankBQr.Focus();
                        labelRankALoaded.Text += Environment.NewLine + currentLedReel.Rank;

                        string ledFamily = currentLedReel.NC12;
                        if (!labelLed12NC.Text.Contains(ledFamily))
                        {
                            labelLed12NC.Text += " " + ledFamily;
                        }

                        CountQtyProductToManufacture();
                        CheckIfFormDataComplete();
                    }
                }
                else
                {
                    textBoxRankAQr.Text = "";
                    MessageBox.Show("Niewłaściwy kod QR!");
                }
            }
        }