예제 #1
0
        public static void AddReelToTrash(string nc12, string id, DataGridView grid, ref CurrentMstOrder currentOrder)
        {
            ledReelData reel = null;

            foreach (var ledReel in currentOrder.LedReels)
            {
                if (ledReel.NC12 == nc12 & ledReel.ID == id)
                {
                    reel = ledReel;
                }
            }

            if (reel != null)
            {
                int binRow = 0;
                for (int r = 0; r < grid.Rows.Count; r++)
                {
                    if (grid.Rows[r].Cells[0].Value == null)
                    {
                        continue;
                    }
                    if (grid.Rows[r].Cells[0].Value.ToString() == reel.Rank)
                    {
                        binRow = r;
                        break;
                    }
                }

                grid.Rows.Insert(binRow + 1, nc12, id, reel.Ilosc);
                reel.RemovedToTrash = true;

                foreach (DataGridViewColumn col in grid.Columns)
                {
                    col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                }
            }
            else
            {
                MessageBox.Show("Nieznana rolka LED");
            }
        }
예제 #2
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();
         }
     }
 }
예제 #3
0
        public static void AddReelToGrid(string nc12, string id, DataGridView grid, ref CurrentMstOrder currentOrder)
        {
            DataTable reelTable      = MST.MES.SqlOperations.SparingLedInfo.GetInfoFor12NC_ID(nc12, id);
            string    qty            = reelTable.Rows[0]["Ilosc"].ToString();
            string    binId          = reelTable.Rows[0]["Tara"].ToString();
            string    zlecenieString = reelTable.Rows[0]["ZlecenieString"].ToString();

            if (currentOrder.OrderNumber == zlecenieString)
            {
                int binRow = 0;
                for (int r = 0; r < grid.Rows.Count; r++)
                {
                    if (grid.Rows[r].Cells[0].Value == null)
                    {
                        continue;
                    }
                    if (grid.Rows[r].Cells[0].Value.ToString() == binId)
                    {
                        binRow = r;
                        break;
                    }
                }

                grid.Rows.Insert(binRow + 1, nc12, id, qty);
                ledReelData newReel = new ledReelData(nc12, double.Parse(qty), "", "", zlecenieString, id, binId);
                currentOrder.LedReels.Add(newReel);

                DgvTools.SumUpLedsInBins(grid);

                foreach (DataGridViewColumn col in grid.Columns)
                {
                    col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                }
            }
            else
            {
                MessageBox.Show("Ta rolka LED przypisana jest zlecenia: " + zlecenieString);
            }
        }
예제 #4
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!");
                }
            }
        }