Example #1
0
        /// <summary>
        /// Initialize the Populate Grid for the DGV
        /// </summary>
        private void lnkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // Open the form Rentals
            // Populate the grid to capture changes
            frmRentals frm = new frmRentals();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }
Example #2
0
        /// <summary>
        /// Initialize the double click event
        /// </summary>
        private void dgvRentalList_DoubleClick(object sender, EventArgs e)
        {
            // If the table is doubled clicked, populate the form according to the index Primary Key value
            // If cell is empty, return nothing
            if (dgvRentalList.CurrentCell == null)
            {
                return;
            }
            // Take the cell index and primary key
            long PKID = long.Parse(dgvRentalList[0, dgvRentalList.CurrentCell.RowIndex].Value.ToString());
            // Open the form accoridng to the PKID
            frmRentals frm = new frmRentals(PKID);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                PopulateGrid();
            }
        }