/// <summary> /// Наш MVVM Патерн /// </summary> /// <param name="detal"></param> public DataDatalization(Detalizacia detal) { var logic = new Logica.Logica(); var contextlogic = new SobytieAndCommandContext.ContextCommand(); var sobytie = new SobytieAndCommandContext.SobytieReport(); var sobytiedbf = new SobytieAndCommandContext.SobytieDbfFile(); Service = new WpfBakcupStart.ContentBakcup.Service.VoidService(); Dialog = new VoidDialog(Service); Years = new AddColection.AddColection().Years(); PanelUl = new SelectPanelUl(); PanelFl = new SelectPanelFl(); Trigers = new TrigersUse(); Tab = new TabControl(); IsSelectedFace = new DelegateCommand(() => Trigers.IsSelectFace()); ListFilesDbf = new ListFilesDbf(); ListReport = new AddColection.AddColection().Report(); Seath = new DelegateCommand(() => Dispatcher.CurrentDispatcher.Invoke(() => logic.Go(detal, Trigers, PanelUl, PanelFl, Years, ListFilesDbf, Tab, ListReport))); RemoveReport = new DelegateCommand(() => contextlogic.RemoveReport(ListReport.Report, ListReport.ShemesFilesReport)); OpenReport = new DelegateCommand(() => contextlogic.OpenReport(ListReport.Report)); FileDropDrapReport = new DelegateCommand <object>(parameter => sobytie.MoveCopy(parameter, ListReport.Report)); FileOpenEvent = new DelegateCommand(() => sobytie.OpenReportEvent(ListReport.Report)); FileOpenDbf = new DelegateCommand((() => sobytiedbf.OpenDbfEvent(ListFilesDbf.FileDbf))); FileDropDrapDbf = new DelegateCommand <object>(parameter => sobytiedbf.MoveCopyDbf(parameter, ListFilesDbf.FileDbf)); OpenDialogWcfBackup = new DelegateCommand <object>((parameter => { Service.SelectDialog(Convert.ToString(parameter), Dialog); })); }
/// <summary> /// Процесс по ФЛ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void worker_DoworkFL(object sender, DoWorkEventArgs e) { try { var logica = new Face.GroupReportTable.AnyUlOnFlReport(); var workbookreport = new XLWorkbook(); var selectzaprosfl = new Face.FL.SqlParamSelect.ZaprosFl(); var colection = new AddColection.AddColection(); var filedbffl = new Face.FL.File.SqlParamFile.AddFileFl(); Detal.Invoke(new MethodInvoker(delegate { Detal.StatusFl.Text = @"Собираем выборки!!!"; })); var parametr = selectzaprosfl.GenerateParam(Fl.InnFl, Fl.SeriaNomerPasport, Fl.Familia, Fl.Name, Fl.MiddleName); TableSqlFl = selectzaprosfl.ZaprosSql(parametr, Yers.SelectYears.Years, Detal); Detal.Invoke(new MethodInvoker(delegate { Detal.StatusFl.Text = @"Собираем файлы!!!"; })); CollectionFileFl = filedbffl.AddF(Yers.SelectYears.Years, parametr, Detal); Detal.Invoke(new MethodInvoker(delegate { Detal.StatusFl.Text = @"Формируем таблицы!!!"; })); TableSqlFl = logica.Generatexsls(TableSqlFl, workbookreport, Arhivator.Pathing.PathName.Path4 + Fl.InnFl + "_" + Fl.SeriaNomerPasport + "_" + Fl.Familia + "_" + Yers.SelectYears.Years); DispatcherHelper.CheckBeginInvokeOnUI(() => { Dispatcher.CurrentDispatcher.Invoke(() => { ListFile.UpdateOn(); Tab.UpdateOn(); Report.UpdateOn(); Task.Run(async() => { await Task.Run(() => { try { colection.FilesDbf(CollectionFileFl, ListFile, Fl.InnFl + "_" + Fl.SeriaNomerPasport + "_" + Fl.Familia); logica.GenereteReport(TableSqlFl, Tab); colection.UpdateReport(Report); ListFile.UpdateOff(); Tab.UpdateOff(); Report.UpdateOff(); } catch (Exception exception) { System.Windows.Forms.MessageBox.Show(exception.ToString()); } }); }); }); }); Detal.BeginInvoke(new MethodInvoker(() => WorkerFl.CancelAsync())); } catch (Exception exception) { System.Windows.Forms.MessageBox.Show(exception.ToString()); } }