Ejemplo n.º 1
0
        public static void ShowLedDetails(DataGridView dataGridViewLedReels, int rowIndex)
        {
            if (dataGridViewLedReels.Rows[rowIndex].Cells[3].Value != null)
            {
                string bin = "";
                for (int r = rowIndex; r >= 0; r--)
                {
                    if (dataGridViewLedReels.Rows[r].Cells[1].Value.ToString().Contains("BIN"))
                    {
                        bin = dataGridViewLedReels.Rows[r].Cells[1].Value.ToString().Replace("BIN", "").Trim();
                        break;
                    }
                }
                string aktZlec = dataGridViewLedReels.Rows[rowIndex].Cells[3].Value.ToString();
                string nc12    = dataGridViewLedReels.Rows[rowIndex].Cells[0].Value.ToString();
                string id      = dataGridViewLedReels.Rows[rowIndex].Cells[1].Value.ToString();

                using (EditLedReel editForm = new EditLedReel(DataStorage.currentOrder.orderNo, bin, (int)DataStorage.currentOrder.numberOfBins))
                {
                    if (editForm.ShowDialog() == DialogResult.OK)
                    {
                        MST.MES.SqlOperations.SparingLedInfo.UpdateLedZlecenieStringBinId(nc12, id, editForm.newOrder, editForm.newBin);

                        DataStorage.currentBins = new Dictionary <string, CurrentBinStruct>();
                        dgvTools.PrepareDgvForBins(dataGridViewLedReels, (int)DataStorage.currentOrder.numberOfBins);
                        LedReels.AddLedReelsForLot(DataStorage.currentOrder.orderNo, dataGridViewLedReels);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void SetUpComponentsForOrder()
        {
            UpdateLabels();
            DataStorage.currentBins = new Dictionary <string, CurrentBinStruct>();
            dgvTools.PrepareDgvForBins(dataGridViewLedReels, (int)DataStorage.currentOrder.numberOfBins);
            LedReels.AddLedReelsForLot(DataStorage.currentOrder.orderNo, dataGridViewLedReels);
            buttonChangeQty.Visible         = true;
            buttonChangePlannedDate.Visible = true;

            var prodWerehoueStock = MST.MES.SqlOperations.ConnectDB.CheckHowManyProductsOnProdWerehouse(DataStorage.currentOrder.modelId + "46");

            if (prodWerehoueStock.Count > 0)
            {
                foreach (var locationEntry in prodWerehoueStock)
                {
                    lProdWerehouseStock.Text += $"{locationEntry.Key} - {locationEntry.Value} szt." + Environment.NewLine;
                }
            }
        }
Ejemplo n.º 3
0
        private void butAddLeds_click(object sender, EventArgs e)
        {
            if (labelLotNumber.Text.Length > 6)
            {
                using (AddLedReel ledForm = new AddLedReel(int.Parse(labelBinQty.Text)))
                {
                    if (ledForm.ShowDialog() == DialogResult.OK)
                    {
                        bool binAnd12NCCorrect = true;

                        if (DataStorage.currentBins.ContainsKey(ledForm.binId))
                        {
                            if (ledForm.nc12 != DataStorage.currentBins[ledForm.binId].nc12)
                            {
                                binAnd12NCCorrect = false;
                            }
                        }

                        if (binAnd12NCCorrect)
                        {
                            if (release)
                            {
                                MST.MES.SqlOperations.SparingLedInfo.UpdateLedZlecenieStringBinId(ledForm.nc12, ledForm.id, DataStorage.currentOrder.orderNo, ledForm.binId);
                            }

                            LedReels.AddReelToGrid(ledForm.nc12, ledForm.id, DataStorage.currentOrder.orderNo, dataGridViewLedReels);
                        }
                        else
                        {
                            string correctBin = "";
                            foreach (var binEntry in DataStorage.currentBins)
                            {
                                if (binEntry.Value.nc12 == ledForm.nc12)
                                {
                                    correctBin = binEntry.Key;
                                }
                            }
                            MessageBox.Show("Ten numer 12NC diody został przypisany do BINu " + correctBin);
                        }
                    }
                }
            }
        }