Example #1
0
        public List <TwoDateColumnRelationContainer <string> > getExistRelationFormExistExcel()
        {
            List <TwoDateColumnRelationContainer <string> > relationContainerList = new List <TwoDateColumnRelationContainer <string> >();
            DirectoryInfo TheFolder = new DirectoryInfo(relationExcelFolderPath);

            foreach (FileInfo NextFile in TheFolder.GetFiles())
            {
                if (NextFile.Extension.Equals(excelExtensions[0]) || NextFile.Extension.Equals(excelExtensions[1]))
                {
                    if (NextFile.Extension.Equals(excelExtensions[0]))
                    {
                        string nameWithoutExtension = NextFile.Name.Remove(NextFile.Name.Length - 5, 5);

                        TwoDateColumnRelationContainer <string> twoDateColumnRelationContainer = packageNameWithoutExtension(nameWithoutExtension);

                        relationContainerList.Add(twoDateColumnRelationContainer);
                    }
                    if (NextFile.Extension.Equals(excelExtensions[1]))
                    {
                        string nameWithoutExtension = NextFile.Name.Remove(NextFile.Name.Length - 4, 4);

                        TwoDateColumnRelationContainer <string> twoDateColumnRelationContainer = packageNameWithoutExtension(nameWithoutExtension);

                        relationContainerList.Add(twoDateColumnRelationContainer);
                    }
                }
            }
            return(relationContainerList);
        }
Example #2
0
        private TwoDateColumnRelationContainer <string> packageNameWithoutExtension(string nameWithoutExtension)
        {
            string[] relationColumns = nameWithoutExtension.Split(new char[1] {
                '-'
            });
            TwoDateColumnRelationContainer <string> twoDateColumnRelationContainer = new TwoDateColumnRelationContainer <string>();

            twoDateColumnRelationContainer.Add(relationColumns[0]);
            twoDateColumnRelationContainer.Add(relationColumns[1]);

            return(twoDateColumnRelationContainer);
        }