Exemple #1
0
        public PO_MainScreen()
        {
            InitializeComponent();
            sql    = new MySQLDatabaseDriver();
            poList = new ArrayList();

            //ADJUST DATAGRIDVIEW COLUMN ALIGNMENT
            //Center column headers
            dgvPO.Columns["OrderDate"].HeaderCell.Style.Alignment    = DataGridViewContentAlignment.MiddleCenter;
            dgvPO.Columns["DeliveryDate"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvPO.Columns["PONumber"].HeaderCell.Style.Alignment     = DataGridViewContentAlignment.MiddleCenter;

            //Center column contents
            dgvPO.Columns["OrderDate"].DefaultCellStyle.Alignment    = DataGridViewContentAlignment.MiddleCenter;
            dgvPO.Columns["DeliveryDate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvPO.Columns["PONumber"].DefaultCellStyle.Alignment     = DataGridViewContentAlignment.MiddleCenter;

            //TEST CODE (For the purpose of customizing the DGV and checking out its appearance)

            /*dgvPO.Rows.Add("09/24/2015", "09/30/2015", "Fat Shaolin Jaideite Kiosk", "BPO#1609-018", "Lucid Co.");
             * dgvPO.Rows.Add("11/30/2015", "12/30/2015", "St. Theresa School of Novaliches", "BPO#1611-002", "Fluora’s Shop");
             * dgvPO.Rows.Add("09/30/2015", "10/30/2015", "Basic Co.", "BPO#1609-001", "Cinco Company");
             * dgvPO.Rows.Add("08/23/2015", "09/15/2015", "Basic Co.", "BPO#1608-041", "Mayers Balay");*/

            sql.SelectAllPODGV(dgvPO);
            dgvPO.Sort(dgvPO.Columns["PONumber"], ListSortDirection.Descending); //Sort datagridview by LATEST PO Number (Note: When you add a PO, it should appear at the top of the DGV)

            sql.SelectAllPO(poList);
        }
Exemple #2
0
        private void btnClearSearch_Click(object sender, EventArgs e)
        {
            //Minor flaw: If you click ClearSearch multiple times, the dgv gets populated again, even though nothing was searched. Hehe.
            dgvPO.Rows.Clear();
            sql.SelectAllPODGV(dgvPO); //Populate DGV

            //Sort datagridview by LATEST PO Number
            dgvPO.Sort(dgvPO.Columns["PONumber"], ListSortDirection.Descending);

            txtSearch.Text            = "Search for...";
            cbbFilterBy.SelectedIndex = 0; //Sets the combobox value to "Filter by..."
        }