/// <summary> /// When the Update menu item is clicked, open the item update window. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemsUpdateMenuItem_Click(object sender, RoutedEventArgs e) { this.Hide(); itemsWindow.ShowDialog(); UpdateItemList(); this.Show(); }
/// <summary> /// Displays the item windows to manage ite,s /// </summary> public void displayItemScreen() { Items.wndItems itemWindow = new Items.wndItems(); itemWindow.ShowDialog(); int rows = 0; itemList = itemLogic.GetItems(ref rows); }
/// <summary> /// Opens the search page or items page when clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuItem_Click(object sender, RoutedEventArgs e) { if ((sender as MenuItem).Name == "searchMenuItem") { // displays the search window Search.wndSearch search = new Search.wndSearch(); search.ShowDialog(); } else if ((sender as MenuItem).Name == "editMenuItem") { // displays the items window Items.wndItems itms = new Items.wndItems(); itms.ShowDialog(); //requery the combo box in case of changes made to item list. } }
/// <summary> /// Opens the search page or items page when clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuItem_Click(object sender, RoutedEventArgs e) { try { if ((sender as MenuItem).Name == "searchMenuItem") { // displays the search window Search.wndSearch search = new Search.wndSearch(logic); search.ShowDialog(); addInvoiceCanvas.Visibility = Visibility.Hidden; // displays selected invoice in the datagrid selectedInvoiceDataGrid.ItemsSource = logic.DisplayInvoie(); // update label dislays invoice number selectedInvoiceLbl.Content = "Selected Invoice #" + logic.selectedInvoice; } else if ((sender as MenuItem).Name == "editMenuItem") { // displays the items window Items.wndItems itms = new Items.wndItems(); itms.ShowDialog(); addInvoiceCanvas.Visibility = Visibility.Hidden; itemsComboBox.Text = ""; itemsComboBox.SelectedIndex = -1; itemsComboBox.Items.Clear(); itemCostTxtBox.Text = ""; totalCostTxtBox.Text = ""; } } catch (Exception ex) { //This is the top level method so we want to handle the exception HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// Menu control for items /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Item_TableClick(object sender, RoutedEventArgs e) { try { this.Hide(); ItemsWindow.ShowDialog(); this.Show(); Quanitiy_Input.Text = ""; Price.Text = ""; Item_List_2.SelectedIndex = -1; Save_Invoice.IsEnabled = false; DisableInputs(); UpdateDisplay(); } catch (Exception ex) { throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType + "." + MethodInfo.GetCurrentMethod().Name + "->" + ex.Message); } }