Esempio n. 1
0
        public DashboardMenu()
        {
            try
            {
                InitializeComponent();

                availableOptions = new Dictionary<System.Windows.Controls.Primitives.ToggleButton, UserControl>();

                home = new HomeContent();
                newQuote = new NewQuoteContent();
                customer = new CustomerSettingsContent();
                priceSettings = new PriceSettingsContent();
                soSection = new SalesOrderContent();
                worksheetSection = new WorksheetContent();
                invoice = new InvoiceContent();
                makePayment = new MakeInvoicePayment();
                commanderSection = new CommanderSectionContent();
                barcodePrinter = new BarcodePrinter();

                availableOptions.Add(btnHome, home);
                availableOptions.Add(btnCreateNewQuote, newQuote);
                availableOptions.Add(btnPriceSettings, priceSettings);
                availableOptions.Add(btnCustomerSettings, customer);
                availableOptions.Add(btnSaleOrder, soSection);
                availableOptions.Add(btnWorksheet, worksheetSection);
                availableOptions.Add(btnInvoice, invoice);
                availableOptions.Add(btnMakePayment, makePayment);
                availableOptions.Add(btnCommanderSection, commanderSection);
                availableOptions.Add(btnBarcodePrinter, barcodePrinter);

                btnHome.IsChecked = true;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
        private void OpenSalesOrder()
        {
            try
            {
                Dashboard parent = Window.GetWindow(this) as Dashboard;

                SaleOrderEntity entity = dgSaleOrderDetails.SelectedItem as SaleOrderEntity;

                if (entity == null)
                {
                    return;
                }

                DashboardMenu sideMenu = parent.ucDashboardMenu.CurrentPage as DashboardMenu;
                if (sideMenu != null)
                {
                    sideMenu.IsIndirectCall = true;
                    sideMenu.btnSaleOrder.IsChecked = true;
                    sideMenu.IsIndirectCall = false;
                }

                SalesOrderContent newQuote = new SalesOrderContent(true, entity.QuoteNumber);
                parent.ucMainContent.ShowPage(newQuote);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
 private void ShowSaleOrderForm()
 {
     try
     {
         Dashboard parent = Window.GetWindow(this) as Dashboard;
         if (parent != null)
         {
             DashboardMenu sideMenu = parent.ucDashboardMenu.CurrentPage as DashboardMenu;
             DashboardHelper.ChangeDashboardSelection(parent, sideMenu.btnSaleOrder);
             SalesOrderContent soContent = new SalesOrderContent(true, txtQuoteNumber.Text);
             parent.ucMainContent.ShowPage(soContent);
         }
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }