コード例 #1
0
ファイル: AlteraAula.cs プロジェクト: Kyoro93/GestaoDeAulas
        private void refreshComboBox()
        {
            try
            {
                ConexaoMySQL  conn        = new ConexaoMySQL();
                List <string> horarios    = conn.SelectHorarios();
                List <string> professores = conn.SelectProfessores();
                List <string> turmas      = conn.SelectTurmas();

                foreach (string s in horarios)
                {
                    cbbHorario.Items.Add(s.Split(';')[1]);
                }

                foreach (string s in professores)
                {
                    cbbProfessor.Items.Add(s);
                }

                foreach (string s in turmas)
                {
                    cbbTurma.Items.Add(s.Split(';')[1] + "/" + s.Split(';')[2]);
                }

                cbbHorario.SelectedItem   = this.strAntigoHorario;
                cbbProfessor.SelectedItem = this.strAntigoProfessor;
                cbbTurma.SelectedItem     = this.strAntigaTurma + "/" + this.strAntigoBloco;
                rtbConteudo.Text          = this.strAntigoConteudo;
                mtcCalendario.SetSelectionRange(Convert.ToDateTime(strAntigaData.ToString()), Convert.ToDateTime(strAntigaData.ToString()));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
コード例 #2
0
        private void refreshComboBox()
        {
            try
            {
                ConexaoMySQL  conn        = new ConexaoMySQL();
                List <string> horarios    = conn.SelectHorarios();
                List <string> professores = conn.SelectProfessores();
                List <string> turmas      = conn.SelectTurmas();

                foreach (string s in horarios)
                {
                    cbbHorario.Items.Add(s.Split(';')[1]);
                }

                foreach (string s in professores)
                {
                    cbbProfessor.Items.Add(s);
                }

                foreach (string s in turmas)
                {
                    cbbTurma.Items.Add(s.Split(';')[1] + "/" + s.Split(';')[2]);
                }
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
コード例 #3
0
        private void refreshDataGridView()
        {
            ConexaoMySQL  conn     = new ConexaoMySQL();
            List <string> horarios = conn.SelectHorarios();

            dgvHorarios.Rows.Clear();
            foreach (string s in horarios)
            {
                dgvHorarios.Rows.Add(s.Split(';')[0], s.Split(';')[1]);
            }
            conn = null;
        }