private void btnAddNewRecord_Click(object sender, EventArgs e)
        {
            var addRentalRecord = new frmAddEditRentalRecord();

            addRentalRecord.MdiParent = this.MdiParent;
            addRentalRecord.Show();
        }
        private void addRentalRecordToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var rentalRecord = new frmAddEditRentalRecord();

            rentalRecord.MdiParent = this;
            rentalRecord.Show();
        }
        private void btnEditRecord_Click(object sender, EventArgs e)
        {
            try
            {
                // get id of selected row
                var id = (int)dgvRentalRecord.SelectedRows[0].Cells["RentalId"].Value;
                //query the database for record
                var record = db.CarRentalRecords.FirstOrDefault(x => x.RentalId == id);

                //launch Edit window
                var addEdirRentalRecord = new frmAddEditRentalRecord(record);
                addEdirRentalRecord.MdiParent = this.MdiParent;
                addEdirRentalRecord.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Error: {ex.Message}");
            }
        }