private void ChangeResAcceptBtn_Click(object sender, EventArgs e) // aanpassing bevestigen { HidePanelsRecursively(this); Res_pnl.Show(); Order_pnl.Show(); int reservationId = int.Parse(Reservationlv.SelectedItems[0].SubItems[0].Text); int tableId = int.Parse(Reservationlv.SelectedItems[0].SubItems[1].Text); string reservationName = Reservationlv.SelectedItems[0].SubItems[2].Text; string reservationTel = Reservationlv.SelectedItems[0].SubItems[3].Text; string reservationEmail = Reservationlv.SelectedItems[0].SubItems[4].Text; string reservationComment = Reservationlv.SelectedItems[0].SubItems[5].Text; DateTime reservationDate = DateTime.Parse(Reservationlv.SelectedItems[0].SubItems[6].Text); if (!string.IsNullOrEmpty(reservationId.ToString())) { tableId = int.Parse(TafelResDD.Text.ToString()); reservationTel = telBox.Text; reservationName = aamBox.Text; reservationEmail = emailBox.Text; reservationComment = opmerkingBox.Text; reservationDate = DateTime.Parse(datumBox.Text); } else { throw new Exception("Er is iets fout gegaan!"); } Reservering r = new Reservering(); r.reservationId = int.Parse(Reservationlv.SelectedItems[0].SubItems[0].Text); r.tableId = int.Parse(Reservationlv.SelectedItems[0].SubItems[1].Text); r.reservationName = Reservationlv.SelectedItems[0].SubItems[2].Text; r.reservationTel = Reservationlv.SelectedItems[0].SubItems[3].Text; r.reservationEmail = Reservationlv.SelectedItems[0].SubItems[4].Text; r.reservationComment = Reservationlv.SelectedItems[0].SubItems[5].Text; r.reservationDate = DateTime.Parse(Reservationlv.SelectedItems[0].SubItems[6].Text); if (res_service.EditReservering(r) == true) { MessageBox.Show($"Rerservering gewijzigd!"); FillResList(); ChangeRes_pnl.Hide(); } else { MessageBox.Show("Er is iets fout gegaan"); } }
private void BackBtn_Click(object sender, EventArgs e) { ChangeRes_pnl.Hide(); Res_pnl.Show(); }