/// <summary> /// Method to open the item inventory window /// </summary> /// <param name="sender">Items menu item</param> /// <param name="e">Click</param> private void ItemInventory_Click(object sender, RoutedEventArgs e) { try { wndItems wndItems = new wndItems(); //calls wndItems form wndItems.ShowDialog(); //Display the new changes if any if (wndItems.IsChanged) { //Load the combo box with items clsMain.updateItemWindow(); List <string> list = clsMain.getItems(); itemsListcomboBox.Items.Clear(); //empty the combo box for (int i = 0; i < list.Count; i++) { itemsListcomboBox.Items.Add(list.ElementAt(i)); } } deleteMsgLabel.Visibility = Visibility.Hidden; } catch (Exception ex) { CheckingErrors(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// Focuses the update window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UpdateTableMenuItem_Click(object sender, RoutedEventArgs e) { this.Hide(); wndItems = new wndItems(); wndItems.ShowDialog(); this.Show(); }
/// <summary> /// Menu -> Edit -> Item - Opens "items" window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuItem_Click_1(object sender, RoutedEventArgs e) { //open "items" window. //MessageBox.Show("Opens ITEMS window"); wndItems items = new wndItems(); items.ShowDialog(); }
/// <summary> /// Menu -> Edit -> Item - Opens "items" window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuItem_Click_1(object sender, RoutedEventArgs e) { this.Hide(); wndItems items = new wndItems(); items.ShowDialog(); this.Show(); }
private void EditItem_btn_Click(object sender, RoutedEventArgs e) { //goes to items page this.Hide(); //open "search" window. wndItems itemsWindow = new wndItems(); itemsWindow.ShowDialog(); this.Show(); }
/// <summary> /// Opens up the Window Items Form /// Look at items. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void miDefTable_Click(object sender, RoutedEventArgs e) { try { this.Hide(); wndItemsForm.ShowDialog(); this.Show(); } catch (Exception ex) { HandleError.handleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// Item List Menu Button /// Sends User to list of all Items /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemListMenu_Click(object sender, RoutedEventArgs e) { try { wndItems Items = new wndItems(); Items.ShowDialog(); mainLogic.ResetItemsList(); ItemComboBox.ItemsSource = mainLogic.ItemsList.ToList(); } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// This will open the items window and hide this window /// </summary> private void itemsLink_Click(object sender, RoutedEventArgs e) { try { wndItems itemsWindow = new wndItems(); this.Hide(); itemsWindow.ShowDialog(); this.Show(); } catch (Exception ex) { MessageBox.Show("Unable to open Items window. " + ex.ToString(), "Error - Open Items Window", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
/// <summary> /// Handles the Item Inventory Menu item click. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemInventory_Click(object sender, RoutedEventArgs e) { try { wndItems wndItems = new wndItems(); wndItems.ShowDialog(); } catch (Exception ex) { //this is reflection HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } finally { //Code to be ran no matter what. Closing connnections to dbs/web } }
/// <summary> /// menu control when items is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemsTab_Click(object sender, RoutedEventArgs e) { try { this.Hide(); ItemsWindow.ShowDialog(); this.Show(); AmountOfItems.Text = ""; ItemCostTextBox.Text = ""; cbItems.SelectedIndex = -1; SaveInvoice.IsEnabled = false; DisableAllInput(); UpdateDisplays(); } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// Load the items window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ItemsHeader_Click(object sender, RoutedEventArgs e) { try { //Open items window var items = new wndItems(); items.ShowDialog(); //only reload if there is an invoice loaded and that invoice has a good value if (invoice != null && !string.IsNullOrWhiteSpace(invoice.sInvoiceNum)) { LoadInvoice(Convert.ToInt32(invoice.sInvoiceNum)); //if items were alraedy displayed for an invoice, reload so it's accurate } LoadItems(); } 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> /// Update button click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UpdateButton_Click(object sender, RoutedEventArgs e) { try { //Hide the menu this.Hide(); //Show the item form wndItems.ShowDialog(); //Show the Items form this.Show(); //Since the item database may have been updated //Clear out select item box and reload it } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// Click on this button and it will navigate you to the Edit Items Window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void itemItems_Click(object sender, RoutedEventArgs e) { try { itemsWindow = new wndItems(); this.Hide(); itemsWindow.ShowDialog(); //Update all dropdowns to reflect any changes (dropdown.itemsSource =) this.Show(); cmbInvoiceItem.ClearValue(ItemsControl.ItemsSourceProperty); cmbInvoiceItem.ItemsSource = ml.getItems().Select(a => a.ItemDesc); } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// OnClick handler for the ItemList MenuItem /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">Event object</param> private void ItemListMenu_Click(object sender, RoutedEventArgs e) { try { //Show the item screen as a dialog wndItems wndItems = new wndItems(); wndItems.ShowDialog(); //After returning from the item screen refresh the items ML.RefreshItems(); if (ML.CurrentInvoice != null) { ML.RefreshSelectedInvoice(); TotalLbl.Content = ML.CurrentInvoice._Total; } } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// Opens Items Window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuItemUpdateItems_Click(object sender, RoutedEventArgs e) { try { windowItems.Left = this.Left; windowItems.Top = this.Top; this.Hide(); MenuToggleButton.IsChecked = false; //close drawer windowItems.ShowDialog(); //TODO: Check the flag for an update and update the items dropdown if there was a change //check if there was a change to the items, if there was a change update the items dropdown if (windowItems.HasChanged == true) { mainLogic.GetItems(); } this.Left = windowItems.Left; this.Top = windowItems.Top; this.Show(); } catch (Exception ex) { HandleException(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
private void Button_Click(object sender, RoutedEventArgs e) { items.ShowDialog(); }