private void button3_Click(object sender, EventArgs e) { if (this.camposObligatoriosCompletos()) { if (this.habitacionNoExiste()) { int tipo = this.determinarTipo(cbTipoHab.Text.ToString()); Habitacion habitacion = new Habitacion(Convert.ToInt32(tbNumHab.Text), Convert.ToInt32(tbcodHotel.Text), Convert.ToInt32(tbPiso.Text), Convert.ToChar(cbUbicacion.Text), tipo, tbDescripcion.Text.ToString(), rbSi.Checked); habitacion.guardar(); this.Close(); } else { MessageBox.Show("Hay 2 habitaciones con el mismo numero en el mismo hotel", "Habitacion error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Campos obligatorios incompletos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }