private string getIdGrupoMuscular(int id) { GrupoMuscular grupoMuscular = new GrupoMuscular(); string nome = ""; foreach (GrupoMuscular grupo in grupoMuscular.selectArray("where id_grupoMuscular = " + id)) { nome = grupo.Nome; } return(nome); }
private void FrmCadExercicios_Activated(object sender, EventArgs e) { try { GrupoMuscular grupo = new GrupoMuscular(); ArrayList array = grupo.selectArray("order by nome"); comboGrupoMuscular.DataSource = array; comboGrupoMuscular.DisplayMember = "nome"; comboGrupoMuscular.ValueMember = "id"; } catch { } }
public FrmAltGrupoMuscular(int id) { InitializeComponent(); #region Carrega os grupos musculares GrupoMuscular grupo = new GrupoMuscular(); ArrayList array = grupo.selectArray("where id_grupoMuscular = " + id); foreach (GrupoMuscular grup in array) { id2 = grup.Id; textNome.Text = grup.Nome; } #endregion }
private void FrmAltExercicios_Load(object sender, EventArgs e) { #region Carrega os exercicios try { GrupoMuscular grupos = new GrupoMuscular(); comboGrupoMuscular.DataSource = grupos.selectArray("order by nome"); comboGrupoMuscular.DisplayMember = "nome"; comboGrupoMuscular.ValueMember = "id"; } catch { } comboGrupoMuscular.SelectedValue = idGrupoMuscular; #endregion }
private void FrmAltTreino_Activated(object sender, EventArgs e) { #region Carrega os Alunos try { Alunos aluno = new Alunos(); ArrayList array = aluno.selectArray("order by nome"); comboAluno.DataSource = array; comboAluno.DisplayMember = "nome"; comboAluno.ValueMember = "id"; } catch { } #endregion #region Carrega os Treinadores try { Treinadores treinador = new Treinadores(); ArrayList array = treinador.selectArray("order by nome"); comboTreinador.DataSource = array; comboTreinador.DisplayMember = "nome"; comboTreinador.ValueMember = "id"; } catch { } #endregion #region Carrega os Objetivos try { Objetivo objetivo = new Objetivo(); ArrayList array = objetivo.selectArray("order by nome"); comboObjetivo.DataSource = array; comboObjetivo.DisplayMember = "nome"; comboObjetivo.ValueMember = "id"; } catch { } #endregion #region Carrega os Grupos Musculares try { GrupoMuscular grupo = new GrupoMuscular(); ArrayList array = grupo.selectArray("order by nome"); comboGrupoMuscular.DataSource = array; comboGrupoMuscular.DisplayMember = "nome"; comboGrupoMuscular.ValueMember = "id"; } catch { } #endregion comboAluno.SelectedValue = idAluno; comboTreinador.SelectedValue = idTreinador; comboObjetivo.SelectedValue = idObjetivo; }