private void btnBaja_Click(object sender, EventArgs e) { try { conexion.Open(); SqlCommand comando = null; comando = new SqlCommand("AEFI.baja_Hotel", conexion); comando.CommandType = CommandType.StoredProcedure; comando.Parameters.Add(new SqlParameter("@ID_Hotel", lbIdHotel.Text)); comando.Parameters.Add(new SqlParameter("@Fecha_Inicio", dtpInicio.Value)); comando.Parameters.Add(new SqlParameter("@Fecha_Fin", dtpFin.Value)); comando.Parameters.Add(new SqlParameter("@Descripcion", rtbMotivos.Text)); SqlDataReader dr = comando.ExecuteReader(); MessageBox.Show("El Hotel se dio de baja satisfactoriamente", "Baja Hotel", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (SqlException exc) { MessageBox.Show("El Hotel no se puede dar de Baja, revise que no existan Reservas o Estadias en el Periodo de Baja o que ya no este dado de Baja", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { conexion.Close(); } FormListaDeHoteles listado = new FormListaDeHoteles(); this.Hide(); listado.ShowDialog(); this.Close(); }
private void btnVolver_Click(object sender, EventArgs e) { if (x == 0) { FormMenu inicio = new FormMenu(); this.Hide(); inicio.ShowDialog(); this.Close(); } else if (x == 1) { FormListaDeHoteles listado = new FormListaDeHoteles(); this.Hide(); listado.ShowDialog(); this.Close(); } }
private void btnListaHoteles_Click(object sender, EventArgs e) { FormListaDeHoteles lh = new FormListaDeHoteles(); this.Hide(); lh.ShowDialog(); this.Close(); }