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); } } } }
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(); }); }
private void PrintButtonClick() { var main = GetParentViewModel<MainViewModel>(); main.SelectModule(ModuleType.ImprimerAvertissements, x => { ViewModelHelper.EnsureModuleViewModel(main.SelectedModule, main, tasksGridControl); ((BaseModuleControl) main.SelectedModule).Refresh(); }); }
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; }
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(); }
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); }
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(); }
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; }
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(); }
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(); }); }
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])"; }
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(); }); }
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(); }); }
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(); }); }
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); } } }
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(); }); }