private void btnExercicios_Click(object sender, EventArgs e) { this.Hide(); telaManterExercicios telaExercicios = new telaManterExercicios(cod_user); telaExercicios.Closed += (s, args) => this.Close(); telaExercicios.Show(); }
private void btnVoltar_Click_1(object sender, EventArgs e) { this.Hide(); telaManterExercicios manterExercicio = new telaManterExercicios(cod_user); manterExercicio.Closed += (s, args) => this.Close(); manterExercicio.Show(); }
private void btnSalvar_Click(object sender, EventArgs e) { if (lsAlunosAtividade.Items.Count > 0) { Professor p = new Professor(); string cod_professor = p.getIDProfessor(cod_user); try { cod_turma = turmas[cbRelacaoTurmas.SelectedIndex].cod_turma; } catch (ArgumentException) { } //CADASTRA A NOVA ATIVIDADE NO BANCO Exercicio exercicio = new Exercicio(); string cod_atividade = exercicio.cadastraAtividade(dtpPrazo.Value.ToShortDateString(), DateTime.Now.ToShortDateString(), cod_professor, cod_jogo); //SE NOVA ATIVIDADE FOI CADASTRADA COM SUCESSO, VINCULA LISTA DE ALUNOS A ATIVIDADE if (!cod_atividade.StartsWith("ERRO:")) { string resposta = ""; //CARREGA A LISTBOX COM OS ALUNOS E O CODIGO DA ATIVIDADE CRIADA for (int i = 0; i < turmas[cbRelacaoTurmas.SelectedIndex].alunos.Count; i++) { resposta = exercicio.cadastraAlunosAtividade(turmas[cbRelacaoTurmas.SelectedIndex].alunos[i].cod_aluno, cod_atividade); } MessageBox.Show(resposta); this.Hide(); telaManterExercicios manterExercicio = new telaManterExercicios(cod_user); manterExercicio.Closed += (s, args) => this.Close(); manterExercicio.Show(); } } else { MessageBox.Show("Turma sem alunos. Não foi possível criar exercício"); } }