// get predefined sequence template for current orders public void GetSequenceTemplateCurrent() { string query = "select edjob#, edseq#, edruns, edcomq from cmsdat.cjobdr order by edjob#, edseq#"; ExcoODBC odbcConnection = ExcoODBC.Instance; odbcConnection.Open(database); OdbcDataReader reader = odbcConnection.RunQuery(query); while (reader.Read()) { string wo = reader[0].ToString().Trim(); SeqTemplate seqTemplate = new SeqTemplate(); seqTemplate.seqNum = Convert.ToInt32(reader[1]); seqTemplate.runtime = Convert.ToDouble(reader[2]); seqTemplate.compQuant = Convert.ToInt32(reader[3]); if (seqTemplateMap.ContainsKey(wo)) { seqTemplateMap[wo].Add(seqTemplate.seqNum, seqTemplate); } else { Dictionary <int, SeqTemplate> newSeqTemplateMap = new Dictionary <int, SeqTemplate>(); newSeqTemplateMap.Add(seqTemplate.seqNum, seqTemplate); seqTemplateMap.Add(wo, newSeqTemplateMap); } } reader.Close(); }
// get predefined sequence template for history orders public void GetSequenceTemplateHistory() { string query = "select edjob#, edseq#, edruns, edcomq from cmsdat.hjobdr where edseq#=20 order by edjob#, edseq#"; ExcoODBC odbcConnection = ExcoODBC.Instance; odbcConnection.Open(database); OdbcDataReader reader = odbcConnection.RunQuery(query); while (reader.Read()) { string wo = reader[0].ToString().Trim(); SeqTemplate seqTemplate = new SeqTemplate(); seqTemplate.seqNum = Convert.ToInt32(reader[1]); seqTemplate.runtime = Convert.ToDouble(reader[2]); seqTemplate.compQuant = Convert.ToInt32(reader[3]); if (!seq20HJOBHMap.ContainsKey(wo)) { seq20HJOBHMap.Add(wo, seqTemplate); } } reader.Close(); query = "select edjob#, edseq#, edruns, edcomq from cmsdat.hjobdr where edseq#=30 order by edjob#, edseq#"; reader = odbcConnection.RunQuery(query); while (reader.Read()) { string wo = reader[0].ToString().Trim(); SeqTemplate seqTemplate = new SeqTemplate(); seqTemplate.seqNum = Convert.ToInt32(reader[1]); seqTemplate.runtime = Convert.ToDouble(reader[2]); seqTemplate.compQuant = Convert.ToInt32(reader[3]); if (!seq30HJOBHMap.ContainsKey(wo)) { seq30HJOBHMap.Add(wo, seqTemplate); } } reader.Close(); }