예제 #1
0
        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();
 }
예제 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     dataHotel.DataSource = HotelServicio.TraerHoteles();
     dataHotel.Show();
 }
예제 #4
0
 private void LlenarCmbHotel()
 {
     cmbHotel.DataSource    = HotelServicio.TraerHoteles();
     cmbHotel.SelectedIndex = -1;
 }
 private void ListarHoteles()
 {
     cmbHotel.DataSource = HotelServicio.TraerHoteles();
 }
예제 #6
0
 private void LlenarComboHoteles()
 {
     cmbHotel.DataSource     = HotelServicio.TraerHoteles();
     cmbHotel.SelectedIndex  = -1;
     dataClientes.DataSource = null;
 }
예제 #7
0
 private Hotel CrearHotel()
 {
     return(new Hotel(HotelServicio.ProximoId(), textNombre.Text, textDireccion.Text, comboEstrellas.SelectedIndex, rbSi.Checked));
 }