private void btnVoltar_Click(object sender, EventArgs e) { Form admin = new Administração(); admin.Show(); this.Hide(); }
private void btnEnviar_Click(object sender, EventArgs e) { Administração form = new Administração(); SqlConnection con = new SqlConnection(StringConexao.connectionString); SqlDataReader reader; SqlCommand cmd = new SqlCommand("select Aluno from vwNotifAluno where Ativada = 1", con); try { con.Open(); } catch (Exception exc) { throw new Exception(exc.Message); } try { reader = cmd.ExecuteReader(); while (reader.Read()) { string txt = reader["Aluno"].ToString(); string aulaav = cmbAulaAvaliacao.SelectedValue.ToString(); if (aulaav == "") { MessageBox.Show("Selecione alguma coisa!"); } else { form.ckdAulasSolicitas.Items.Add(txt + " - " + aulaav); } } reader.Close(); } catch (SqlException ex) { throw new Exception(ex.Message); } finally { con.Close(); } Form aluno = new Aluno(); this.Hide(); aluno.Show(); }