/// <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> /// Constructor that initializes the components and binds the items combo box to the items list in the main logic class /// </summary> public wndMain() { InitializeComponent(); itemsWindow = new Items.wndItems(); searchWindow = new Search.wndSearch(this); mainLogic = new clsMainLogic(); isInvoiceBeingEdited = false; cboItems.ItemsSource = mainLogic.Items; }
/// <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); } }
public wndMain() { try { InitializeComponent(); //searchWindow = new Search.wndSearch(this); //searchItems = new Items.wndItems(this); MainLogic = new clsMainLogic(); MyList = new List <clsLineItems>(); editOrAdd = false; //Items go into combo box Item_List_2.ItemsSource = MainLogic.ListItems(); //populates data grid Item_Display.ItemsSource = MyList; /* * clsSql.sInvoiceNum = ""; * clsSql.sTotalCost = ""; * clsSql.sInvoiceDate = "";*/ //initalize window ItemsWindow = new Items.wndItems(this); clsSL = new clsSearchLogic(); Edit_Invoice.IsEnabled = false; Delete_Invoice.IsEnabled = false; Save_Invoice.IsEnabled = false; } catch (Exception ex) { throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType + "." + MethodInfo.GetCurrentMethod().Name + "->" + ex.Message); } }