public void IdentifyTypeReport(string buildNumber, string projectName, string folderName) { var ext = new List <string> { ".xml" }; string[] fileEntries = Directory.GetFiles(Path.Combine(inif.Read("XMLPath", "PathFilesXML"), folderName)).Where(s => ext.Contains(Path.GetExtension(s))).ToArray(); foreach (string fileName in fileEntries) { try { XElement fileXML = ReadXML(fileName); int analyticReportId = ProcessHeaderXMLReport(fileXML, fileName); if (analyticReportId != 0) { int analyticProjectId = ProcessXMLProject(projectName); int analyticReportAuxId = 0; AnalyticReportAux dataAnalyticReportAux = AnalyticReportAuxDB.CreateObject().SelectAnalyticReportByCodeReport(analyticReportId, buildNumber, analyticProjectId); if (dataAnalyticReportAux.Id == 0) { AnalyticReportAux analyticReportAux = new AnalyticReportAux { BuildNumber = buildNumber, DateAnalyticReportAux = DateTime.Now, AnalyticReportId = analyticReportId, AnalyticProjectId = analyticProjectId, XmlInfo = fileXML.ToString() }; analyticReportAuxId = AnalyticReportAuxDB.CreateObject(analyticReportAux).SaveAnalyticReportAux(); ProcessXMLData(fileXML, analyticReportAuxId); } } } catch (Exception e) { Console.WriteLine($"Exception error: '{e}' - File name error: " + fileName + ""); } } }
private AnalyticReportAuxDB(AnalyticReportAux _analyticReportAux) => analyticReportAux = _analyticReportAux;