Beispiel #1
0
 public ExcelTableLoader(ExcelContext excelContext, string path, string filename)
 {
     _filepath       = path;
     _filename       = filename;
     _excelContext   = excelContext;
     _excelDataTable = new ExcelDataTable(_filepath, _filename.Remove(_filename.LastIndexOf(".")));
 }
Beispiel #2
0
        /// <summary>
        /// 设置excel路径。
        /// </summary>
        /// <param name="directory"></param>
        private void SetExcelDataDirectory(string directory)
        {
            if (!Directory.Exists(directory))
            {
                return;
            }

            ExcelPathText.Text = directory;
            TableCheckBoxList.Items.Clear();
            _excelContext.ExcelDataDirectory = directory;
            _iniFile.IniWriteValue(IniSectionName, IniNameOfExcelDataDirectory, directory);

            string          filterWord = ExcelFilterTextBox.Text;
            List <FileInfo> fileInfos  = ExcelContext.FilterFile(directory, ExcelContext.ExcelSuffix);

            foreach (var fileInfo in fileInfos)
            {
                if (filterWord.Equals(""))
                {
                    TableCheckBoxList.Items.Add(fileInfo);
                }
                else if (fileInfo.Name.Contains(filterWord))
                {
                    TableCheckBoxList.Items.Add(fileInfo);
                }
            }
        }
 public ExcelDataTableCheck(ExcelContext excelContext, ExcelDataTable excelDataTable)
 {
     _excelContext   = excelContext;
     _excelDataTable = excelDataTable;
 }