private void ShowCmbCategorySub() { FinanceCategorySub fcSub = new FinanceCategorySub(); fcSub.FinanceCategory = (FinanceCategory)cmbCategory.SelectedItem; if (cmbCategory.SelectedItem == null) { return; } cmbCategorySub.Items.Clear(); cmbCategorySub.Items.Add("Carregando ..."); cmbCategorySub.Items.Clear(); foreach (FinanceCategorySub x in FinanceCategorySubDAO.ListAllBy(fcSub)) { cmbCategorySub.Items.Add(x); } cmbCategorySub.ValueMember = "Id"; cmbCategorySub.DisplayMember = "Name"; }
private void showGrid() { FinanceCategory financeCategory = new FinanceCategory(); FinanceCategorySub financeCategorySub = new FinanceCategorySub(); if (cmbBuscarType.SelectedIndex != 0) { financeCategory.Type = cmbBuscarType.SelectedIndex; } if (cmbBuscarCategory.SelectedItem != null) { financeCategory = (FinanceCategory)cmbBuscarCategory.SelectedItem; } financeCategorySub.FinanceCategory = financeCategory; dgList.Rows.Clear(); foreach (FinanceCategorySub x in FinanceCategorySubDAO.ListAllBy(financeCategorySub)) { dgList.Rows.Add(x.Id, x.Name, x.FinanceCategory.Name); } }
private void cmbBuscarCategory_SelectedValueChanged(object sender, EventArgs e) { FinanceCategorySub fcSub = new FinanceCategorySub(); fcSub.FinanceCategory = (FinanceCategory)cmbBuscarCategory.SelectedItem; if (fcSub.FinanceCategory == null) { return; } cmbBuscarCategorySub.Items.Clear(); cmbBuscarCategorySub.Items.Add("Carregando ..."); cmbBuscarCategorySub.Items.Clear(); foreach (FinanceCategorySub x in FinanceCategorySubDAO.ListAllBy(fcSub)) { cmbBuscarCategorySub.Items.Add(x); } cmbBuscarCategorySub.ValueMember = "Id"; cmbBuscarCategorySub.DisplayMember = "Name"; }