Esempio n. 1
0
        private ArrayList rfqList; //All RFQs

        //CONSTRUCTOR
        public RFQ_MainScreen()
        {
            InitializeComponent();
            sql     = new MySQLDatabaseDriver();
            rfqList = new ArrayList();

            //---ADJUST DATAGRIDVIEW APPEARANCE
            //Center column headings
            dgvRFQ.Columns["RequestDate"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvRFQ.Columns["RFQNo"].HeaderCell.Style.Alignment       = DataGridViewContentAlignment.MiddleCenter;
            //Center column cell contents
            dgvRFQ.Columns["RFQNo"].DefaultCellStyle.Alignment       = DataGridViewContentAlignment.MiddleCenter;
            dgvRFQ.Columns["RequestDate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            //---STREAM READER
            sql.SelectAllRFQDGV(dgvRFQ); //Populate DGV
            sql.SelectAllRFQ(rfqList);

            //Sort datagridview by LATEST RFQ Number (Note: When you add an RFQ, it should appear at the top of the DGV)
            dgvRFQ.Sort(dgvRFQ.Columns["RFQNo"], ListSortDirection.Descending);

            //Default selected row is the first row
            if (dgvRFQ.Rows.Count != 0)
            {
                dgvRFQ.Rows[0].Selected = true;
            }
        }
Esempio n. 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.
            dgvRFQ.Rows.Clear();
            sql.SelectAllRFQDGV(dgvRFQ); //Populate DGV

            //Sort datagridview by LATEST RFQ Number
            dgvRFQ.Sort(dgvRFQ.Columns["RFQNo"], ListSortDirection.Descending);

            txtSearch.Text            = "Search for...";
            cbbFilterBy.SelectedIndex = 0; //Sets the combobox value to "Filter by..."
        }
Esempio n. 3
0
        public PQ_CreateFromRFQForm()
        {
            InitializeComponent();
            sql    = new MySQLDatabaseDriver();
            pqList = new ArrayList();


            rfqList         = new ArrayList();
            selectedRFQList = new ArrayList();
            sql.SelectAllRFQDGV(dgvRFQSelection);
            sql.SelectAllRFQ(rfqList);
        }