Esempio n. 1
0
        bool bAddItem;//delete later


        #endregion


        #region MainWindow() - Constructor
        /// <summary>
        /// MainWindow() - Constructor
        /// </summary>
        public wndMain()
        {
            //loads window wndMain
            InitializeComponent();

            //To close application -  to be included in all WPF applications - makes sure other windows close and the objects that have been instantiated will be cleared from memory.
            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;

            //instantiate MainLogic object so that we can use methods from the clsMainLogic class
            MainLogic = new clsMainLogic();

            //instantiate newLstInvoice object so that we can pass our list from MainLogic.lstInvoice into newLstInvoice
            newLstInvoice = new List <clsInvoice>();

            newLstLineItems = new List <clsLineItems>();

            newLstItemDesc = new List <clsItemDesc>();

            //^^^^^^^^Might not need the new list

            lstInvoiceItems = new List <clsInvoiceItems>();

            editItem_btn.IsEnabled   = false;
            addItem_button.IsEnabled = false;
            deleteItem_btn.IsEnabled = false;

            items_cbo.IsEnabled = false;

            bAddItem = false;//delete later
        }
Esempio n. 2
0
        /// <summary>
        /// MainWindow() - Constructor
        /// </summary>
        public wndMain()
        {
            //loads window wndMain
            InitializeComponent();

            //To close application -  to be included in all WPF applications - makes sure other windows close and the objects that have been instantiated will be cleared from memory.
            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;

            //instantiate MainLogic object so that we can use methods from the clsMainLogic class
            MainLogic = new clsMainLogic();

            //instantiate newLstInvoice object so that we can pass our list from MainLogic.lstInvoice into newLstInvoice
            newLstInvoice = new List <clsInvoice>();

            newLstLineItems = new List <clsLineItems>();

            newLstItemDesc = new List <clsItemDesc>();

            //get the lstInvoice from MainLogic and pass it into our new list called newLstInvoice
            newLstInvoice = MainLogic.GetInvoice();

            //bind the data from our new list onto our datagrid called dataGridView
            dataGridView1.ItemsSource = newLstInvoice;

            /*need to add button columns*/

            create_btn.IsEnabled = false;
            edit_btn.IsEnabled   = false;
        }