Пример #1
0
        public static void AddReelToGrid(string nc12, string id, string aktZlecenie, DataGridView grid)
        {
            DataTable reelTable = MST.MES.SqlOperations.SparingLedInfo.GetInfoFor12NC_ID(nc12, id);
            string    qty       = reelTable.Rows[0]["Ilosc"].ToString();
            string    binId     = reelTable.Rows[0]["Tara"].ToString();

            if (!DataStorage.currentBins.ContainsKey(binId))
            {
                var    ledName = LedNaming.GetLedName(DataStorage.nc12ToOracleSpec[nc12].name);
                string cct     = "";
                foreach (var part in ledName.Split(' '))
                {
                    if (part[part.Length - 1] == 'K')
                    {
                        cct = part;
                    }
                }
                CurrentBinStruct binNfo = new CurrentBinStruct
                {
                    cct  = cct,
                    name = ledName,
                    nc12 = nc12
                };
                DataStorage.currentBins.Add(binId, binNfo);
            }


            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, aktZlecenie);

            dgvTools.SumUpLedsInBins(grid);

            foreach (DataGridViewColumn col in grid.Columns)
            {
                col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            }
        }
Пример #2
0
        public static void AddLedReelsForLot(string lot, DataGridView grid)
        {
            DataTable     sqlTable  = MST.MES.SqlOperations.SparingLedInfo.GetReelsForLot(lot);
            List <string> checkList = new List <string>();

            if (sqlTable.Rows.Count > 0)
            {
                foreach (DataRow row in sqlTable.Rows)
                {
                    string nc12 = row["NC12"].ToString();
                    string id   = row["ID"].ToString();
                    if (checkList.Contains(nc12 + id))
                    {
                        continue;
                    }

                    var    reelTable   = MST.MES.SqlOperations.SparingLedInfo.GetInfoFor12NC_ID(nc12, id);
                    string aktZlecenie = reelTable.Rows[0]["ZlecenieString"].ToString();

                    string qty = row["Ilosc"].ToString();
                    string bin = row["Tara"].ToString();

                    if (!DataStorage.currentBins.ContainsKey(bin))
                    {
                        var    ledName = LedNaming.GetLedName(DataStorage.nc12ToOracleSpec[nc12].name);
                        string cct     = "";
                        foreach (var part in ledName.Split(' '))
                        {
                            if (part[part.Length - 1] == 'K')
                            {
                                cct = part;
                            }
                        }
                        CurrentBinStruct binNfo = new CurrentBinStruct
                        {
                            cct  = cct,
                            name = ledName,
                            nc12 = nc12
                        };
                        DataStorage.currentBins.Add(bin, binNfo);
                    }

                    AddReelToGrid(nc12, id, aktZlecenie, grid);
                    checkList.Add(nc12 + id);
                }
            }
        }