Пример #1
0
        /// <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);
            }));
        }
Пример #2
0
        public void Go(Detalizacia detal, TrigersUse trigerselect, SelectPanelUl ul, SelectPanelFl fl, YearsDbf years, ListFilesDbf filedbf, Collections.ColectionTab.TabControl tab, ListFileReport report)
        {
            ReaderCommandDbfClient service = new ReaderCommandDbfClient("BasicHttpBinding_IReaderCommandDbf");

            DispatcherHelper.Initialize();
            Triger   = trigerselect;
            Ul       = ul;
            Fl       = fl;
            Yers     = years;
            Detal    = detal;
            ListFile = filedbf;
            Report   = report;
            Tab      = tab;
            if (service.IsActive())
            {
                if (Yers.IsValidation())
                {
                    if (Triger.IsCheked)
                    {
                        if (!Fl.IsValidation())
                        {
                            Triger.IsEnableButtonFl             = false;
                            WorkerFl.WorkerReportsProgress      = true;
                            WorkerFl.WorkerSupportsCancellation = true;
                            WorkerFl.DoWork             += worker_DoworkFL;
                            WorkerFl.ProgressChanged    += worker_progressChangeFL;
                            WorkerFl.RunWorkerCompleted += worker_RunWorkerCompleteFL;
                            WorkerFl.RunWorkerAsync();
                        }
                    }
                    else
                    {
                        if (!Ul.IsValidation())
                        {
                            Triger.IsEnableButtonUl             = false;
                            WorkerUl.WorkerReportsProgress      = true;
                            WorkerUl.WorkerSupportsCancellation = true;
                            WorkerUl.DoWork             += worker_DoworkUL;
                            WorkerUl.ProgressChanged    += worker_progressChangeUL;
                            WorkerUl.RunWorkerCompleted += worker_RunWorkerCompleteUL;
                            WorkerUl.RunWorkerAsync();
                        }
                    }
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show(
                    @"Ошибка сервис не может принять запрос в связи с резервным копированием");
            }
        }