private void ComboBoxSelectionChangedExecute() { string priviousTextile = SelectedTextile; TextileColorList = null; TextileList = null; RaisePropertyChanged("TextileColorList"); RaisePropertyChanged("TextileList"); List <string> textileList = new List <string>(); if (!_workbookDictionary.TryGetValue(FileName, out IWorkbook dictionaryWorkbook)) { string fileNamePath = string.Concat(AppSettingConfig.InventoryHistoryRecordFilePath(), "/", FileName); Tuple <List <string>, IWorkbook> tuple = ExcelModule.GetExcelWorkbook(fileNamePath); TextileList = tuple.Item1; GetShippingDate(tuple.Item2.GetSheetAt(1)); _workbookDictionary.Add(FileName, tuple.Item2); } else { for (int sheetCount = 1; sheetCount < dictionaryWorkbook.NumberOfSheets; sheetCount++) { ISheet sheet = dictionaryWorkbook.GetSheetAt(sheetCount); //獲取第i個工作表 textileList.Add(sheet.SheetName); } TextileList = textileList; GetShippingDate(dictionaryWorkbook.GetSheetAt(1)); } RaisePropertyChanged("TextileList"); SelectedTextile = priviousTextile; RaisePropertyChanged("SelectedTextile"); }
public InventoryRecordCompareViewModel() { IEnumerable <string> existsFileName = Directory.GetFiles(AppSettingConfig.InventoryHistoryRecordFilePath(), "*.xlsx").Select(System.IO.Path.GetFileName).OrderByDescending(o => o); InventoryRecordFileList = existsFileName; }