예제 #1
0
        public static void ProcessFiles(Object[] eFiles)
        {
            //DEPENDENCE INYECTION. WE CAN NOW CHANGE THE PROCESSDATA
            IExcelUtils repository = RepositoryLocator.Resolve <IExcelUtils>();

            foreach (Object eFile in eFiles)
            {
                EFileBeingProcesing = eFile;
                String    fileName = ((ExcelFile)eFile).Path;
                DataTable data     = loadDataFromExcel(fileName);
                //BE CAREFULL, HERE WE GO TO THE INTERFACE. THE CLASS WHICH INHERIT IT IS IN PROCESSESDATA/FEERRATASPROCESSESDATA.CS
                repository.processData(data);
                EFileBeingProcesing = null;
            }
            EventHelper.OnPrintInfo("TERMINADO CORRECTAMENTE. Por favor, compruebe el log.");
        }
예제 #2
0
        public static object[] loadFiles(string path)
        {
            object[]    oFiles     = new object[0];
            IExcelUtils repository = RepositoryLocator.Resolve <IExcelUtils>();

            try
            {
                if (!string.IsNullOrEmpty(path))
                {
                    string[] files = Directory.GetFiles(path);
                    oFiles = repository.filesFilter(files, path);
                    return(oFiles);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(oFiles);
        }