void ViewModel_SelectedModuleTypeChanged(object sender, System.EventArgs e)
        {
            RibbonForm mainForm = modulesPanel.FindForm() as RibbonForm;

            if (mainForm != null)
            {
                mainForm.Ribbon.UnMergeRibbon();
                if (mainForm.Ribbon.StatusBar != null)
                {
                    mainForm.Ribbon.StatusBar.UnMergeStatusBar();
                }
            }
            modulesPanel.Controls.Clear();
            Control module = ViewModel.GetModule(ViewModel.SelectedModuleType) as Control;

            ViewModelHelper.EnsureModuleViewModel(module, ViewModel);
            if (module != null)
            {
                module.Dock = DockStyle.Fill;
                modulesPanel.Controls.Add(module);
            }
            if (mainForm != null)
            {
                IRibbonModule ribbonModule = module as IRibbonModule;
                if (ribbonModule != null)
                {
                    mainForm.Ribbon.MergeRibbon(ribbonModule.Ribbon);
                    if (mainForm.Ribbon.StatusBar != null)
                    {
                        mainForm.Ribbon.StatusBar.MergeStatusBar(ribbonModule.Ribbon.StatusBar);
                    }
                }
            }
        }
示例#2
0
        void OnPrintClick(object sender, EventArgs e)
        {
            MainViewModel main = GetParentViewModel <MainViewModel>();

            main.SelectModule(ModuleType.SalesPrint, (x) => {
                ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, GetParentViewModel <MainViewModel>(), salesGridControl);
                ((BaseModuleControl)main.SelectedModule).Refresh();
            });
        }
示例#3
0
 private void PrintButtonClick()
 {
     var main = GetParentViewModel<MainViewModel>();
     main.SelectModule(ModuleType.ImprimerAvertissements, x =>
     {
         ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, main, tasksGridControl);
         ((BaseModuleControl) main.SelectedModule).Refresh();
     });
 }
示例#4
0
        void PrintButtonClick()
        {
            MainViewModel main = GetParentViewModel <MainViewModel>();

            main.SelectModule(ModuleType.TaskPrint, (x) =>
            {
                ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, main, tasksGridControl);
                ((BaseModuleControl)main.SelectedModule).Refresh();
            });
        }
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            var moduleLocator = GetService <Services.IModuleLocator>();

            employeeView = moduleLocator.GetModule(ModuleType.EmployeeView) as EmployeeView;
            ViewModelHelper.EnsureModuleViewModel(employeeView, ViewModel, ViewModel.SelectedEntityKey);
            employeeView.Dock   = DockStyle.Fill;
            employeeView.Parent = pnlView;
        }
示例#6
0
        void GotoModule(ModuleType mt, object param)
        {
            var moduleLocator = GetService <Services.IModuleLocator>();

            openedSubModule = moduleLocator.GetModule(mt) as BaseModuleControl;
            ViewModelHelper.EnsureModuleViewModel(openedSubModule, ViewModel, param);
            openedSubModule.Dock   = DockStyle.Fill;
            openedSubModule.Parent = this;
            openedSubModule.OnTransitionCompleted();
            openedSubModule.BringToFront();
        }
示例#7
0
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            var moduleLocator = GetService <Services.IModuleLocator>();

            customerView = moduleLocator.GetModule(ModuleType.CustomerView) as CustomerView;
            ViewModelHelper.EnsureModuleViewModel(customerView, ViewModel, ViewModel.SelectedEntityKey);
            customerView.Dock   = DockStyle.Fill;
            customerView.Parent = pnlView;
            gridView.ExpandMasterRow(0);
        }
示例#8
0
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            var moduleLocator = GetService <Services.IModuleLocator>();

            quoteView = moduleLocator.GetModule(ModuleType.QuoteView) as QuoteView;
            ViewModelHelper.EnsureModuleViewModel(quoteView, ViewModel, ViewModel.SelectedEntityKey);
            quoteView.Dock       = DockStyle.Fill;
            quoteView.Parent     = pnlView;
            quoteView.DataSource = ViewModel.GetOpportunities();
        }
示例#9
0
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            UnsubscribeProductView();
            var moduleLocator = GetService <Services.IModuleLocator>();

            productView = moduleLocator.GetModule(ModuleType.ProductView) as ProductView;
            SubscribeProductView();
            ViewModelHelper.EnsureModuleViewModel(productView, ViewModel, ViewModel.SelectedEntityKey);
            productView.Dock   = DockStyle.Fill;
            productView.Parent = pnlView;
        }
示例#10
0
        private void GotoModule(ModuleType mt, object param)
        {
            var moduleLocator = GetService <IModuleLocator>();

            openedSubModule = moduleLocator.GetModule(mt) as BaseModuleControl;
            UpdateSelectedEntity(tileView1.FocusedRowHandle);
            ViewModelHelper.EnsureModuleViewModel(openedSubModule, ViewModel, param);
            openedSubModule.Dock   = DockStyle.Fill;
            openedSubModule.Parent = this;
            openedSubModule.OnTransitionCompleted();
            openedSubModule.BringToFront();
        }
示例#11
0
        void ShowSale(object data)
        {
            if (data == null)
            {
                return;
            }
            var dataObject = data as DatabaseObject;
            var main       = GetParentViewModel <MainViewModel>();

            main.SelectModule(ModuleType.OrderView, (x) => {
                ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, GetParentViewModel <MainViewModel>(), dataObject.Id);
                ((BaseModuleControl)main.SelectedModule).Refresh();
            });
        }
示例#12
0
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            UnsubscribeOrderViewEvents();
            var moduleLocator = GetService <Services.IModuleLocator>();

            orderView = moduleLocator.GetModule(ModuleType.OrderView) as OrderView;
            SubscribeOrderViewEvents();
            ViewModelHelper.EnsureModuleViewModel(orderView, ViewModel, ViewModel.SelectedEntityKey);
            orderView.Dock   = DockStyle.Fill;
            orderView.Parent = pnlView;
            gridView.ExpandMasterRow(0);
            gridView.ActiveFilterString = "IsOutlookIntervalYesterday([OrderDate]) Or IsOutlookIntervalToday([OrderDate])";
        }
示例#13
0
        void ShowCustomerEdit(Customer customer)
        {
            var main = GetParentViewModel <MainViewModel>();

            main.SelectModule(ModuleType.CustomerEditableView, (x) => {
                if (customer != null)
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, GetParentViewModel <MainViewModel>(), customer.Id);
                }
                else
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, GetParentViewModel <MainViewModel>(), new DefaultEntityInitializer <Customer, DevAV.DevAVDbDataModel.IDevAVDbUnitOfWork>());
                }
                ((BaseModuleControl)main.SelectedModule).Refresh();
            });
        }
示例#14
0
        void ShowEditModule(Product productToEdit)
        {
            var main = GetParentViewModel <MainViewModel>();

            main.SelectModule(ModuleType.ProductsEditableView, (x) => {
                if (productToEdit != null)
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, GetParentViewModel <MainViewModel>(), productToEdit.Id);
                }
                else
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, GetParentViewModel <MainViewModel>(), new DefaultEntityInitializer <Product, DevAV.DevAVDbDataModel.IDevAVDbUnitOfWork>());
                }
                ((BaseModuleControl)main.SelectedModule).Refresh();
            });
        }
示例#15
0
        void ShowEditEmployee(Employee employee)
        {
            var main = GetParentViewModel <MainViewModel>();

            main.SelectModule(ModuleType.EmployeeEdit, (x) =>
            {
                if (employee != null)
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, main, ViewModel.SelectedEntityKey);
                }
                else
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, main, new DefaultEntityInitializer <Employee, DevAV.DevAVDbDataModel.IDevAVDbUnitOfWork>());
                }
                ((EmployeeEdit)main.SelectedModule).Refresh();
            });
        }
示例#16
0
 protected virtual void OnSelectedModuleChanged(object oldModule)
 {
     if (oldModule != null)
     {
         if (ModuleRemoved != null)
         {
             ModuleRemoved(oldModule, EventArgs.Empty);
         }
     }
     if (SelectedModule != null)
     {
         ViewModelHelper.EnsureModuleViewModel(SelectedModule, this);
         if (ModuleAdded != null)
         {
             ModuleAdded(SelectedModule, EventArgs.Empty);
         }
     }
 }
示例#17
0
        private void ShowEditEmployee(Employee employee)
        {
            var main = GetParentViewModel <MainViewModel>();

            main.SelectModule(ModuleType.ModifierEmployé, x =>
            {
                if (employee != null)
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, main, ViewModel.SelectedEntityKey);
                }
                else
                {
                    ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, main,
                                                          new DefaultEntityInitializer <Employee, IPhexonDbUnitOfWork>());
                }
                ((ModifierEmployé)main.SelectedModule).Refresh();
            });
        }