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 OpenInvoice() { try { Dashboard parent = Window.GetWindow(this) as Dashboard; InvoiceEntity entity = dgInvoiceDetails.SelectedItem as InvoiceEntity; if (entity == null) { return; } if (parent != null) { DashboardMenu sideMenu = parent.ucDashboardMenu.CurrentPage as DashboardMenu; DashboardHelper.ChangeDashboardSelection(parent, sideMenu.btnInvoice); InvoiceContent invoice = new InvoiceContent(true, entity.QuoteNumber); parent.ucMainContent.ShowPage(invoice); } } catch (Exception ex) { Logger.LogException(ex); } }
private void btnSendToInvoice_Click(object sender, RoutedEventArgs e) { try { if (string.IsNullOrEmpty(txtQuoteNumber.Text) || string.IsNullOrEmpty(txtWSNumber.Text)) { Helper.ShowErrorMessageBox("No Worksheet selected for generating invoice."); return; } bool isInvoiceExists = BusinessLogic.IsInvoicePresent(txtQuoteNumber.Text); if (isInvoiceExists == true) { Helper.ShowErrorMessageBox("Invoice already exists for current worksheet. Please delete current invoice."); return; } BusinessLogic.GenerateInvoice(txtQuoteNumber.Text, DateTime.Now); Dashboard parent = Window.GetWindow(this) as Dashboard; if (parent != null) { DashboardMenu sideMenu = parent.ucDashboardMenu.CurrentPage as DashboardMenu; DashboardHelper.ChangeDashboardSelection(parent, sideMenu.btnInvoice); InvoiceContent invoice = new InvoiceContent(true, txtQuoteNumber.Text); parent.ucMainContent.ShowPage(invoice); } } catch (Exception ex) { Logger.LogException(ex); } }