示例#1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            ReservationForm reservationForm = new ReservationForm();

            reservationForm.ReservationChanged += ReservationForm_ReservationChanged;
            reservationForm.ShowDialog();
        }
示例#2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvReservations.Rows.Count < 1)
            {
                return;
            }

            Reservation     reservation     = db.Reservations.Find(dgvReservations.SelectedRows[0].Cells[0].Value);
            int             index           = dgvReservations.SelectedRows[0].Index;
            ReservationForm reservationForm = new ReservationForm(db, reservation);

            reservationForm.ReservationChanged += ReservationForm_ReservationChanged;
            reservationForm.ShowDialog();
            dgvReservations.Rows[index].Selected = true;
        }