Esempio n. 1
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.btnLogout = ((System.Windows.Controls.Button)(target));
     
     #line 47 "..\..\..\MainWindow.xaml"
     this.btnLogout.Click += new System.Windows.RoutedEventHandler(this.btnLogout_Click);
     
     #line default
     #line hidden
     return;
     case 2:
     this.userNameTextBlock = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 3:
     this.addNewUser = ((System.Windows.Controls.Button)(target));
     
     #line 60 "..\..\..\MainWindow.xaml"
     this.addNewUser.Click += new System.Windows.RoutedEventHandler(this.addNewUser_Click);
     
     #line default
     #line hidden
     return;
     case 4:
     this.calculatorBtn = ((System.Windows.Controls.Button)(target));
     
     #line 72 "..\..\..\MainWindow.xaml"
     this.calculatorBtn.Click += new System.Windows.RoutedEventHandler(this.calculatorBtn_Click_1);
     
     #line default
     #line hidden
     return;
     case 5:
     this.orderWorkBench = ((ordermanager.Views.UserControls.OrderWorkBench)(target));
     return;
     case 6:
     this.viewOrdersTabControl = ((System.Windows.Controls.TabControl)(target));
     return;
     case 7:
     this.newEnquiryTab = ((System.Windows.Controls.TabItem)(target));
     return;
     case 8:
     this.newEnquiryControl = ((ordermanager.Views.PopUps.NewEnquiryFormUserControl)(target));
     return;
     case 9:
     this.myTasksTab = ((System.Windows.Controls.TabItem)(target));
     return;
     case 10:
     this.myTasks = ((ordermanager.Views.UserControls.ViewOrdersControl)(target));
     return;
     case 11:
     this.allOrdersTab = ((System.Windows.Controls.TabItem)(target));
     return;
     case 12:
     this.allOrdersControl = ((ordermanager.Views.UserControls.ViewOrdersControl)(target));
     return;
     case 13:
     this.tabAssets = ((System.Windows.Controls.TabItem)(target));
     return;
     case 14:
     this.assetsControl = ((ordermanager.Views.UserControls.AssetsControl)(target));
     return;
     case 15:
     this.tabReports = ((System.Windows.Controls.TabItem)(target));
     return;
     case 16:
     this.mask = ((System.Windows.Shapes.Rectangle)(target));
     return;
     }
     this._contentLoaded = true;
 }
        public void UpdateView()
        {
            if (m_Order != null)
            {
                string tabHeader = Convert.ToString(((System.Windows.Controls.HeaderedContentControl)(tabControl.SelectedItem)).Header);
                switch (tabHeader.Trim())
                {
                    case "View Enquiry":
                        {
                            

                            if (tabViewEnquiry.Visibility == System.Windows.Visibility.Visible)
                            {
                                if (viewEnquiry == null)
                                {
                                    viewEnquiry = new NewEnquiryFormUserControl
                                    {
                                        VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                                        HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
                                        IsNewEnquiry = false
                                    };
                                    viewEnquiryHolder.Child = viewEnquiry;
                                }
                                viewEnquiry.SetOrder(m_Order);
                            }
                            break;
                        }
                    case "Budget":
                        {
                            if (materialsControl == null)
                            {
                                materialsControl = new ProductMaterialsControl
                                {
                                    VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                                    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
                                };
                                m_MaterialsViewModel = new ProductMaterialsViewModel();
                                materialsControl.DataContext = m_MaterialsViewModel;
                                materialsControlHolder.Child = materialsControl;
                            }
                            m_MaterialsViewModel.SetOrder(m_Order);
                            break;
                        }
                    case "BOM":
                        {
                            if (purchaseOrderControl == null)
                            {
                                purchaseOrderControl = new PurchaseOrderControl();
                                purchaseOrderControl.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
                                purchaseOrderControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                                m_PurchaseOrderViewModel = new PurchaseOrderControlViewModel();
                                purchaseOrderControl.DataContext = m_PurchaseOrderViewModel;
                                bomHolder.Child = purchaseOrderControl;
                            }
                            m_PurchaseOrderViewModel.SetOrder(m_Order);
                            break;
                        }
                    case "Purchase Order":
                        {
                            if (poControl == null)
                            {
                                poControl = new PurchaseOrderMasterControl();
                                poControl.VerticalAlignment = VerticalAlignment.Stretch;
                                poControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                                purchaseOrderControlHolder.Child = poControl;
                            }
                            if (poControl.Order != m_Order)
                                poControl.SetOrder(m_Order);

                            break;
                        }
                    case "JO":

                        if (joManagerCtrl == null)
                        {
                            joManagerCtrl = new JobOrderManager();
                            joManagerCtrl.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
                            joManagerCtrl.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                            joManagerCtrlHolder.Content = joManagerCtrl;
                        }

                        joManagerCtrl.SetOrder(m_Order);

                        if (joCtrl == null)
                        {
                            joCtrl = new JobOrderJOView();
                            joCtrl.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
                            joCtrl.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                            joCtrlHolder.Content = joCtrl;
                        }

                        joCtrl.SetOrder(m_Order);
                        break;
                    case "History":
                        {
                            if (changeHistoryControl == null)
                            {
                                changeHistoryControl = new ChangeHistoryControl
                                {
                                    VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                                    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
                                };

                                changeHistoryHolder.Child = changeHistoryControl;

                                m_ChangeHistorViewModel = new ChangeHistoryViewModel();
                                changeHistoryControl.DataContext = m_ChangeHistorViewModel;
                            }
                            m_ChangeHistorViewModel.SetOrder(m_Order);
                            break;
                        }
                    case "Invoice":
                        {
                            if (createNewInvoiceControl == null)
                            {
                                createNewInvoiceControl = new CreateNewInvoiceControl
                                {
                                    VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                                    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
                                };

                                tabNewInvoice.Content = createNewInvoiceControl;
                                m_CreateInvoiceViewModel = new CreateNewInvoiceViewModel();
                                createNewInvoiceControl.ViewModel = m_CreateInvoiceViewModel;
                            }

                            m_CreateInvoiceViewModel.SetOrder(m_Order);
                            if (generatedInvoiceControl == null)
                            {
                                generatedInvoiceControl = new GeneratedInvoiceViewerControl
                                {
                                    VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                                    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
                                };
                                tabGeneratedInvoice.Content = generatedInvoiceControl;
                                m_GeneratedInvoiceViewModel = new GeneratedPurchaseOrderViewModel();
                                generatedInvoiceControl.ViewModel = m_GeneratedInvoiceViewModel;
                            }
                            m_GeneratedInvoiceViewModel.SetOrder(m_Order);
                            break;
                        }
                    case "Execution":
                        UpdateExecutionView();
                        break;
                    case "Stock":
                        {
                            if (stockPerOrderControl == null)
                            {
                                stockPerOrderControl = new MaterialStockPerOrderControl
                                {
                                    VerticalAlignment = System.Windows.VerticalAlignment.Stretch,
                                    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
                                };
                                stockerOrderHolder.Child = stockPerOrderControl;
                            }
                            stockPerOrderControl.Order = m_Order;
                            break;
                        }
                }
            }
        }