private void buttonSave_Click(object sender, EventArgs e) { try { var newReservation = new Reservation( null, this.dataGridViewPatientRooms.SelectedRows[0].Cells[0].Value.ToString(), this.dataGridViewPatientRooms.SelectedRows[0].Cells[1].Value.ToString(), this.dataGridViewPatientRooms.SelectedRows[0].Cells[2].Value.ToString(), this.dataGridViewPatients.SelectedRows[0].Cells[0].Value.ToString(), this.dataGridViewPatients.SelectedRows[0].Cells[1].Value.ToString(), this.dataGridViewPatients.SelectedRows[0].Cells[2].Value.ToString(), this.dataGridViewPatients.SelectedRows[0].Cells[3].Value.ToString(), this.dateTimePickerCheckInDate.Value.ToString(), this.dateTimePickerCheckOutDate.Value.ToString()); DialogResult dialogResult = MessageBox.Show("Czy na pewno chcesz dodać rezerwację z następującymi danymi? \n \n" + newReservation.ToString(), "Dodawanie rezerwacji", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { DbAdapter.addReservation(newReservation); Navigator.navigateToChild(new PatientRoomReservations(), this); } else if (dialogResult == DialogResult.No) { // nothing } } catch (Exception exc) { MessageBox.Show(exc.Message, "Wystąpił błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonIsolationMyReservations_Click(object sender, EventArgs e) { Navigator.navigateToChild(new IsolationRooms(), this); }
private void buttonSickAddReservation_Click(object sender, EventArgs e) { Navigator.navigateToChild(new ReservePatientRoom(), this); }
private void button6_Click(object sender, EventArgs e) { Navigator.navigateToChild(new ReserveIsolationRoom(), this); }