private void buttonAgregar_Click(object sender, EventArgs e) { try { if (!rbSi.Checked && !rbNo.Checked && !string.IsNullOrEmpty(this.Errores)) { throw new FormatException("Error en los campos: " + "\n" + this.Errores + "Debe seleccionar si posee o no Amenities"); } if (!rbSi.Checked && !rbNo.Checked) { lblAmenities.ForeColor = System.Drawing.Color.Red; } else { if (!string.IsNullOrEmpty(this.Errores)) { throw new FormatException("Error en los campos: " + "\n" + this.Errores); } HotelServicio.InsertarHotel(CrearHotel()); MessageBox.Show("Se ha ingresado correctamente el hotel"); BorrarCampos(); } } catch (FormatException fex) { MessageBox.Show(fex.Message); } }
private void AltaHabitacionForm_Load(object sender, EventArgs e) { cmbHotel.DataSource = HotelServicio.TraerHoteles(); cmbHotel.SelectedIndex = hotelSeleccionado; CargarPlazas(); CargarCategorias(); }
private void button1_Click(object sender, EventArgs e) { dataHotel.DataSource = HotelServicio.TraerHoteles(); dataHotel.Show(); }
private void LlenarCmbHotel() { cmbHotel.DataSource = HotelServicio.TraerHoteles(); cmbHotel.SelectedIndex = -1; }
private void ListarHoteles() { cmbHotel.DataSource = HotelServicio.TraerHoteles(); }
private void LlenarComboHoteles() { cmbHotel.DataSource = HotelServicio.TraerHoteles(); cmbHotel.SelectedIndex = -1; dataClientes.DataSource = null; }
private Hotel CrearHotel() { return(new Hotel(HotelServicio.ProximoId(), textNombre.Text, textDireccion.Text, comboEstrellas.SelectedIndex, rbSi.Checked)); }