コード例 #1
0
        public List <Exercicio> GetAll(int conteudo)
        {
            ExercicioDAL     dal   = new ExercicioDAL();
            List <Exercicio> lista = dal.ConsultarTodos(conteudo);

            return(lista);
        }
コード例 #2
0
        public Form_Exercicios(Conteudo conteudo)
        {
            InitializeComponent();
            this.conteudo = conteudo;
            ExercicioDAL dal = new ExercicioDAL();

            try
            {
                conteudo.Exercicio = dal.ConsultarTodos(conteudo.ID);
            }
            catch
            {
                this.Close();
            }
            Color cor = ColorTranslator.FromHtml("#000449");

            Grid_Exercicios.RowTemplate.DefaultCellStyle.BackColor          = cor;
            Grid_Exercicios.RowTemplate.DefaultCellStyle.SelectionBackColor = cor;
            Btn_Proximo.BackColor = cor;
            CarregarGrid();
            if (Grid_Exercicios.RowCount > 0)
            {
                foreach (var item in conteudo.Exercicio.Where(x => x.ID == Convert.ToInt32(Grid_Exercicios.Rows[0].Cells[1].Value)))
                {
                    try
                    {
                        Lbl_Respostas.Visible = true;
                        Btn_Proximo.Visible   = true;
                        LimparCampos();
                        Gabarito  = dal.Consultar(item.ID);
                        Resolvido = dal.Consultar(item.ID);
                        Resolvido.Questao.Clear();
                        CarregarSequencia();
                        MostrarQuestao();
                        realizando = true;
                    }
                    catch
                    {
                        this.Close();
                    }
                }
            }
        }
コード例 #3
0
 private void Grid_Conteudos_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Grid_Conteudos.Rows.Count > 0)
     {
         foreach (var item in conteudos.Where(x => x.ID == Convert.ToInt32(Grid_Conteudos.CurrentRow.Cells[1].Value)))
         {
             try
             {
                 Program.PanelCarregando.Visible = true;
                 Program.PanelCarregando.Refresh();
                 ExercicioDAL dal = new ExercicioDAL();
                 exercicios = dal.ConsultarTodos(item.ID);
                 CarregarExercicios();
                 Program.PanelCarregando.Visible = false;
             }
             catch
             {
                 MessageBox.Show("Erro de Conexão, tente novamente", "Enigma", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 Program.PanelCarregando.Visible = false;
             }
         }
     }
 }