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()); } }
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()); } }
private void refreshDataGridView() { ConexaoMySQL conn = new ConexaoMySQL(); List <string> professores = conn.SelectProfessores(); dgvProfessores.Rows.Clear(); foreach (string s in professores) { dgvProfessores.Rows.Add(s); } conn = null; }