public void ImportDataFromExcelExecute() { if (ExcelFilePath != "") { FileService fileService = new FileService(); //ControllerOperation8001 operation = new ControllerOperation8001(); ControllerManager controllerManager = new ControllerManager(); controllerManager.InitializeAllControllerOperation(null); //IControllerOperation controllerOperation = controllerManager.GetController(SelectedControllerType); _operation = controllerManager.GetController(TheController.Type); //ControllerOperationCommon.ProgressBarCancelFlag = false; _operation.SetStaticProgressBarCancelFlag(false); //_operation //_operation = new ControllerOperation8001(); _operation.UpdateProgressBarEvent += UpdateProgressBarUI; _operation.ReadingExcelCompletedEvent += ReadingExcelComplete; _operation.ReadingExcelCancelationEvent += CanceledExcelImportHandler; _operation.ReadingExcelErrorEvent += ReadingExcelErrorHandler; string strErrorMessage; ReadExcelLoopArgumentForIn param = new ReadExcelLoopArgumentForIn(); param.FilePath = ExcelFilePath; param.FileService = fileService; param.Controller = TheController; // System.Threading.Thread thread = new System.Threading.Thread(Read); // thread.Start(param); Read(param); //SCA.BusinessLib.ProjectManager.GetInstance.TheControllerViaImporting = _operation.ReadEXCELTemplate(ExcelFilePath, fileService,TheController,out strErrorMessage); //#region 显示数据选择页面 //ConfigSection = Visibility.Collapsed; //ImportContentSelectorViewModel importContentSelectorVM = new ImportContentSelectorViewModel(); //importContentSelectorVM.TheController = TheController; //importContentSelectorVM.SelfVisibility = Visibility.Visible; //importContentSelectorVM.ImportDataSelectorVisibility = Visibility.Visible; //importContentSelectorVM.InitilizeData(strErrorMessage); //ImportContentSelectorDataContext = importContentSelectorVM; ////importContentSelectorVM= //#endregion ToggleButtonStateForReadingExcel(true); } }
private void Read(object param) { ReadExcelLoopArgumentForIn paramValue = (ReadExcelLoopArgumentForIn)param; _operation.ReadEXCELTemplate(paramValue.FilePath, paramValue.FileService, paramValue.Controller); }