Пример #1
0
 /// <summary>
 /// the Search window Constructor
 /// </summary>
 public wndSearch()
 {
     try
     {
         InitializeComponent();
         MyClsSearchSQL               = new clsSearchSQL();
         MyClsSearchLogic             = new clsSearchLogic();
         InvoicesDataGrid.ItemsSource = MyClsSearchLogic.AllInvoices();     //Database to grid box
         cbChooseInvoice.ItemsSource  = MyClsSearchLogic.OnlyInvoiceNum();  //InvoiceDatabase to Invoice number box
         cbChooseCharge.ItemsSource   = MyClsSearchLogic.OnlyInvoiceCost(); //costDatabase to cost box
     }
     catch (Exception ex)
     {
         HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                     MethodInfo.GetCurrentMethod().Name, ex.Message);
     }
 }
Пример #2
0
        }///end method

        /// <summary>
        /// this Method resets all prior selected indexs on combo box's and date picker for invoices
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ResetButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //calls a method from the search logic class and
                //Reset all selected indexs and display all invoices
                InvoicesDataGrid.ItemsSource = MyClsSearchLogic.AllInvoices();     //Database to grid box
                cbChooseInvoice.ItemsSource  = MyClsSearchLogic.OnlyInvoiceNum();  //Database to Invoice number box
                cbChooseCharge.ItemsSource   = MyClsSearchLogic.OnlyInvoiceCost(); //Database to Total charges box
                dpInvoiceDate.SelectedDate   = null;
            }
            catch (Exception ex)
            {
                HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                            MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }//end method