private void btn_registrar_Click(object sender, EventArgs e) { Entities.User user = service.userLogged(); Rental r = user.lastRental(); bool err = false; string id = ""; try { if (txt_estacion.TextLength == 0) { err = true; MessageBox.Show("Por favor, indique una estación"); } else { if (r == null) { MessageBox.Show("No dispone de ningun alquiler"); throw new ServiceException("Ha-ha"); } id = btn_si.Text; if (btn_si.Checked == true) { Station st = service.findStationById(id); service.returnScooter(r, st); MessageBox.Show("Patinete devuelto, se procede a registrar incidente" + "\nPrecio del recorrido: " + r.Price); registrarIncidente ri = new registrarIncidente(service); ri.ShowDialog(); this.Hide(); } else { if (btn_no.Checked == true) { Station st = service.findStationById(id); service.returnScooter(r, st); MessageBox.Show("Patinete devuelto sin incidentes" + "\nPrecio del recorrido: " + r.Price); this.Hide(); } else { MessageBox.Show("Por favor, seleccione si desea registrar un incidente"); } } } } catch (ServiceException ex) { MessageBox.Show(ex.Message); } }