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); } } } }
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; } } }