private List <List <string> > GetDistinctRepo(string userName) { var query = string.Format("Select DISTINCT Repository,Branch,Tool FROM UserCodeAnalysisData WHERE UserName='******'", userName); List <List <string> > repos = new List <List <string> >(); using (SqlConnection con = new SqlConnection(conString)) { SqlCommands.OpenConnection(con); SqlDataReader reader = SqlCommands.ExecuteRead(con, query); while (reader.Read()) { List <string> repo = new List <string>(); GatingResult result = new GatingResult(); repo.Add(reader["Repository"].ToString()); repo.Add(reader["Branch"].ToString()); repo.Add(reader["Tool"].ToString()); repos.Add(repo); } reader.Close(); } return(repos); }
private GatingResult ParseAnalysisReport(string userName, string path, string branch, Tools tool) { var query = string.Format("Select TOP 1 * FROM UserCodeAnalysisData WHERE UserName='******' AND Repository='{1}' AND Tool='{2}' AND Branch='{3}' order by RunTime DESC", userName, path, (int)tool, branch); GatingResult result = new GatingResult(); using (SqlConnection con = new SqlConnection(conString)) { SqlCommands.OpenConnection(con); SqlDataReader reader = SqlCommands.ExecuteRead(con, query); while (reader.Read()) { result.Reository = reader["Repository"].ToString(); result.Branch = reader["Branch"].ToString(); result.Tool = (Tools)Convert.ToInt64(reader["Tool"]); result.DateTime = reader["RunTime"].ToString(); result.NoOfError = Convert.ToInt32(reader["Result"]); result.Result = GetGatingResult(Convert.ToInt32(reader["Threshold"]), result.NoOfError); } reader.Close(); } return(result); }