public MainWindow()
        {
            InitializeComponent();

            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;

            // New search object
            clsSL = new clsSearchLogic();

            // New Items object
            clsIL = new clsItemsLogic();

            // New Main object
            clsML = new clsMainLogic();

            // New search class object
            clsSearch = new clsSearch();

            // new item class object
            clsItem = new Item();

            // new search object
            CurrentSearch = new wndSearch();

            // new items object
            CurrentItems = new wndItems();

            // Removing blank space in main data grid
            MainDataGrid.CanUserAddRows = false;

            // Removing blank space in main invoice data grid
            mainInvDG.CanUserAddRows = false;
            mainInvDG.IsReadOnly     = true;

            // Locking the edit region until the user chooses to edit an invoice
            lockEditRegion();

            // create invoice pane enable
            createInvCV.IsEnabled = true;

            // create main window invoice object
            MainWindowInvoice = new clsSearch();

            // Populating the item lists in the drop downs
            popItemLists();

            // new invoice list object
            newInvoiceItems = new List <Item>();
        }
        public wndSearch()
        {
            InitializeComponent();

            // New instance of Search Logic class
            clsSL = new clsSearchLogic();

            // Getting all invoice records from the Db
            Invoices = clsSL.GetAllInvoices();

            foreach (var invoice in Invoices)
            {
                // need to display all invoices in each drop down
                InvoiceCB.Items.Add(invoice.InvoiceNum);
                TotalChargesCB.Items.Add(invoice.InvoiceCost);
                DateCB.Items.Add(invoice.InvoiceDate);
            }

            // Populating the data grid
            srchDataGrid.CanUserAddRows = false;
            srchDataGrid.IsReadOnly     = true;
            srchDataGrid.ItemsSource    = clsSL.GetAllInvoices();
        }