private ItemsWindow itemsWindow; // ItemsWindow obj

        public MainWindow()
        {
            InitializeComponent();

            db  = new clsDataAccess();
            sql = new clsSQL();

            ItemPriceTxtBx.IsReadOnly = true;
            TotalTxtBx.IsReadOnly     = true;

            LoadInvoiceComBx();
        }
        /// <summary>
        /// Initialize search window
        /// </summary>
        /// <param name="db">DataAccess class for running queries</param>
        /// <param name="sql">SQL class to get query strings</param>
        public SearchWindow(clsDataAccess db, clsSQL sql)
        {
            try
            {
                InitializeComponent();

                this.db  = db;
                this.sql = sql;
                FillInvoiceDataGrid();
                FillInvoiceComboBox();
            }
            catch (Exception ex)
            {
                throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." + MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
            }
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="db">DataAccess class for running queries</param>
        /// <param name="sql">SQL class to get query strings</param>
        public ItemsWindow(clsDataAccess db, clsSQL sql)
        {
            try
            {
                InitializeComponent();

                this.db  = db;
                this.sql = sql;

                // Ensure textboxes are empty
                ItemCodeTB.Text = "";
                ItemDescTB.Text = "";
                ItemCostTB.Text = "";

                PopulateItemsDataGrid();
            }
            catch (Exception ex)
            {
                throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." + MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
            }
        }