Пример #1
0
        public void fillgdInventory()
        {
            inventoryTable = new DataTable();

            if (rbInventory.Checked)
            {
                dbController.readInventory(inventoryTable);
            }
            else if (rbPurchased.Checked)
            {
                dbController.readPurchasedProduct(inventoryTable);
            }

            dgInventory.DataSource = inventoryTable;
            dgInventory.ColumnHeadersDefaultCellStyle.Font = new Font("Arial", 10, FontStyle.Bold);
            dgInventory.Focus();

            if (rbInventory.Checked)
            {
                colorCodedRows();
            }
            else if (rbPurchased.Checked)
            {
                highlightQtySoldCells();
            }
        }
Пример #2
0
        public void fillgdInventory()
        {
            inventoryTable = new DataTable();
            if (rbInventory.Checked)
            {
                dbController.readInventory(inventoryTable);
            }
            else if (rbPurchased.Checked)
            {
                dbController.readPurchasedProduct(inventoryTable);
            }

            dgInventory.DataSource = inventoryTable;
            dgInventory.ColumnHeadersDefaultCellStyle.Font = new Font("Arial", 10, FontStyle.Bold);
            dgInventory.Focus();

            if (rbInventory.Checked)
            {
                colorCodedRows();
            }
            else if (rbPurchased.Checked)
            {
                highlightQtySoldCells();
            }

            string product_name;

            foreach (DataGridViewRow row in dgInventory.Rows)
            {
                product_name = (string)row.Cells[PRODUCT_NAME_INDEX].Value;
                Product product = dbController.getProductThroughName(product_name);
                if (rbInventory.Checked && mainTab.SelectedTab == tabPage1)
                {
                    dbController.checkProductCriticalLevel(product);
                }
            }
        }