private static List <EcuFunctionStructs.EcuResultStateValue> GetResultStateValueList(SQLiteConnection mDbConnection, EcuFunctionStructs.EcuJobResult ecuJobResult) { List <EcuFunctionStructs.EcuResultStateValue> ecuResultStateValueList = new List <EcuFunctionStructs.EcuResultStateValue>(); string sql = string.Format(@"SELECT ID, " + SqlTitleItems + ", STATEVALUE, VALIDFROM, VALIDTO, PARENTID " + "FROM XEP_STATEVALUES WHERE (PARENTID IN (SELECT STATELISTID FROM XEP_REFSTATELISTS WHERE (ID = {0})))", ecuJobResult.Id); using (SQLiteCommand command = new SQLiteCommand(sql, mDbConnection)) { using (SQLiteDataReader reader = command.ExecuteReader()) { while (reader.Read()) { ecuResultStateValueList.Add(new EcuFunctionStructs.EcuResultStateValue(reader["ID"].ToString(), GetTranslation(reader), reader["STATEVALUE"].ToString(), reader["VALIDFROM"].ToString(), reader["VALIDTO"].ToString(), reader["PARENTID"].ToString())); } } } return(ecuResultStateValueList); }
static List <EcuFunctionStructs.EcuJobResult> GetMatchingEcuJobResults(EcuFunctionStructs.EcuJob ecuJob, EcuFunctionStructs.EcuJobResult ecuJobResultComp) { if (ecuJobResultComp == null || string.IsNullOrEmpty(ecuJobResultComp.Name)) { return(null); } int resultCount = 0; List <EcuFunctionStructs.EcuJobResult> jobResultList = new List <EcuFunctionStructs.EcuJobResult>(); if (ecuJob.EcuJobResultList != null) { foreach (EcuFunctionStructs.EcuJobResult ecuJobResult in ecuJob.EcuJobResultList) { if (!string.IsNullOrEmpty(ecuJobResult.Name)) { resultCount++; if ((string.Compare(ecuJobResult.Name.Trim(), ecuJobResultComp.Name.Trim(), StringComparison.OrdinalIgnoreCase) == 0) && (string.Compare(ecuJobResult.FuncNameResult.Trim(), ecuJobResultComp.FuncNameResult.Trim(), StringComparison.OrdinalIgnoreCase) == 0)) { jobResultList.Add(ecuJobResult); } } } } if (resultCount == 0) { return(null); } return(jobResultList); }