private void cbBlad_SelectedIndexChanged(object sender, EventArgs e) { if (processId != -1) { List <List <string> > solutionsData = gujacz2.ExecuteStoredProcedure("GetSolutions", new string[] { }, DatabaseName.SupportCP); foreach (var a in solutionsData) { Entities.ProcessSolution solution = new ProcessSolution(); solution.id = int.Parse(a[0]); solution.nameCP = a[1]; solution.nameBuissness = a[2]; solutions.Add(solution); } Entities.ProcessError errorInfo = errors.Where(x => x.description == cbBlad.SelectedItem.ToString()).First(); List <List <string> > topSolution = gujacz2.ExecuteStoredProcedure("GetTopErrorAndSolutionForProcess", new string[] { processId.ToString(), errorInfo.id.ToString() }, DatabaseName.SupportCP); cbRozwiazanie.Items.Clear(); foreach (Entities.ProcessSolution so in solutions) { cbRozwiazanie.Items.Add(so.nameCP); } if (topSolution.Count > 0) { cbRozwiazanie.SelectedItem = solutions.Where(x => x.id == int.Parse(topSolution[0][2])).FirstOrDefault().nameCP; } } }
/// <summary> /// here we need to know if the selected project has a sln file /// if it does we need the list of projects from it to replace /// the projlist.projects or something like it /// </summary> /// <param name="pList"></param> /// <param name="projPtr"></param> /// <returns></returns> private List <ProjectNameAndSync> GetProjectsForSolutionIfExtant(int projPtr) { //int ptr = lvProjects.SelectedItems[projPtr].Index; var slnPath = ProjList.Projects[projPtr].DevSLNPath; List <ProjectNameAndSync> pList = new List <ProjectNameAndSync>(); if (!string.IsNullOrWhiteSpace(slnPath) && rbSolution.Checked) { // the path may have/not have the filename in it, ensure it there if (Path.GetFileName(slnPath).ToLower().IndexOf(".sln") == -1) { slnPath = Path.Combine(slnPath, $"{Path.GetFileNameWithoutExtension(slnPath)}.sln"); } ProcessSolution ps = new ProcessSolution(slnPath, false); // following line only gets the project fullPath in the PNAS objects pList = ps.ProjectList; // we still need the syncID for the project and ProcessSolution // could not get that for us if (pList.Count > 0) { // the sln had projects, we need a syncID for each var mp = new MaintainProject(); foreach (var p in pList) { string url = mp.GetGitURLFromPath(p.Name); // if a project is not in gitHub the url will be blank if (string.IsNullOrWhiteSpace(url)) { url = Path.GetFileNameWithoutExtension(p.Name); } var o = ProjList.Projects.Find(x => x.GitURL == url && x.DevProjectName == Path.GetFileNameWithoutExtension(p.Name)); if (o != null) { p.SyncID = o.SyncID; } else { // missing a sync record for project, DevProjects table has bad project entry _ = new LogError($"Could not find a SyncID for '{p.Name}', Invalid Project Data in DevProjects Table, project will not be in report.", true, "frmReporter.btnCreateReport_Click(ProjectDetail"); } } } } else { // no solution file, just the selected project will be used pList.Add( new ProjectNameAndSync { Name = ProjList.Projects[projPtr].DevProjectName, SyncID = ProjList.Projects[projPtr].SyncID }); } return(pList); }
private void LoadComponents() { Dictionary <int, string> kat = gujacz2.getBillingComponents(0); dodatkoweDane[0] = kat.Where(x => x.Value == "CRM").FirstOrDefault().Key; Dictionary <int, string> rodz = new Dictionary <int, string>(); rodz = gujacz2.getBillingComponents(kat.Where(x => x.Value == "CRM").FirstOrDefault().Key); //Dictionary<int, string> dodatkoweDane[1] = rodz.Where(x => x.Value == "błąd procesu").FirstOrDefault().Key; Dictionary <int, string> typy = new Dictionary <int, string>(); typy = gujacz2.getBillingComponents(rodz.Where(x => x.Value == "błąd procesu").FirstOrDefault().Key); foreach (var k in typy) { cbTypProcesu.Items.Add(new Entities.BillingDthLBItem() { Text = k.Value, Value = k.Key }); } //cbTypProcesu.Items.AddRange(typy.Values.ToArray()); List <List <string> > solutionsData = gujacz2.ExecuteStoredProcedure("GetSolutions", new string[] { }, DatabaseName.SupportCP); foreach (var a in solutionsData) { Entities.ProcessSolution solution = new ProcessSolution(); solution.id = int.Parse(a[0]); solution.nameCP = a[1]; solution.nameBuissness = a[2]; solutions.Add(solution); } cbRozwiazanie.Items.Clear(); foreach (Entities.ProcessSolution so in solutions) { cbRozwiazanie.Items.Add(so.nameCP); } dodatkoweInfo(); }