public wndSearch(MainWindow window)
 {
     InitializeComponent();
     controller = new clsSearchLogic();
     LoadInvoiceList();
     LoadDateList();
     LoadCostList();
     ParentWindow = window;
 }
示例#2
0
 /// <summary>
 /// Constructor of a new instance of the wndSearch object
 /// </summary>
 public wndSearch()
 {
     try
     {
         InitializeComponent();
         selectedInvoiceId = 0;                    // set selected invoice id to 0
         logic             = new clsSearchLogic(); // initialize the clsSearchLogic class
     }
     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);
     }
 } // end of constructor
 /// <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);
     }
 }
        public wndSearch()
        {
            try
            {
                InitializeComponent();

                searchLogic = new clsSearchLogic();
                searchSQL   = new clsSearchSQL();
                ObservableCollection <clsInvoice> invoices = searchLogic.getInvoices(searchSQL.SelectAllInvoices());
                dgInvoices.ItemsSource = invoices;

                cboNum.ItemsSource  = searchLogic.getInvoiceNums();
                cboDate.ItemsSource = searchLogic.getInvoiceDates();
                cboCost.ItemsSource = searchLogic.getInvoiceCosts();
            }
            catch (Exception ex)
            {
                HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                            MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
示例#5
0
        public wndSearch()
        {
            //On initialization, get the current database of invoices from the MainLogic class
            //Set it in the SearchLogic class
            try
            {
                InitializeComponent();
                searchLogic = new clsSearchLogic();

                //load all invoices into InvoiceListBox data grid
                InvoiceListBox.ItemsSource = searchLogic.InvoiceList;

                //load correct list into combo boxes
                InvoiceNumComboBox.ItemsSource   = searchLogic.NumbersList;
                InvoiceDateComboBox.ItemsSource  = searchLogic.DatesList;
                InvoiceTotalComboBox.ItemsSource = searchLogic.TotalsList;
            }
            catch (Exception ex)
            {
                HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }