public bool GetDataForIndex() { // Variable that determines whether there information to indexed and procces bool lReturn = false; //Counter for calles to the Apli int countGetDataForApi = 0; //Local Variebles for the analysis of information and aplication flow List <AnalysisDataDto> listForAnalysisData = new List <AnalysisDataDto>(); try { // The list of information of the data obtainded to index List <DataIndexDto> listData = new IndexDataComponent().GetDataAnalysis(); // if list have more o items this line runs if (listData.Count > 0) { GetDataForApi(ref listData, ref listForAnalysisData, ref countGetDataForApi); } // if list have more o items this line runs if (listForAnalysisData.Count > 0) { new IndexDataComponent().SaveAnalisysData(listForAnalysisData); } lReturn = true; } catch (InvalidOperationException iex) { //This message es throw by closing conection with api and the system know to manager if (iex.Message.Contains("Error Api Aylien")) { if (listForAnalysisData.Count > 0) { new IndexDataComponent().SaveAnalisysData(listForAnalysisData); } } throw iex; } catch (Exception ex) { throw ex; } return(lReturn); }
/// <summary> /// Author: Jesús Alberto Correa /// Date: 16/12/2015 /// Description: Class to manage the Indexed of information /// Update: /// </summary> public void IndexationData() { var listDataForIndex = new List <IndexDataDto>(); DirectoryInfo directoryInfo; string directoryPath = NexsoHelper.AssemblyDirectory.Replace("bin", "App_Data"); directoryInfo = new DirectoryInfo(directoryPath + SettingsAppIndex.Default.LuceneFullPath); //Get data for indexed listDataForIndex = new IndexDataComponent().GetDataForIndex(); //If validate that the list has records for continuo proceses if (listDataForIndex.Count > 0) { IndexedData(directoryInfo, listDataForIndex); } }