Doubt to Load ComboBox from an account with the subaccount

0

I made a select to fetch an account and load the sub account and would like your opinion to see if this is how it does if it is correct

code

    private void cbbConta_SelectedIndexChanged(object sender, EventArgs e)
    {

        PlanoContasDTO objPlanoConta = new PlanoContasDTO();

        objPlanoConta.DescricaoPlanoContas = cbbConta.Text;

        objPlanoConta = new PlanoContasModel().PesqContaNome(objPlanoConta);

        int conta = objPlanoConta.CodConta;

        CarregarSubContaCombo(conta);
    }

follows the screen images

Choose the consumer account

ChooseAccountSubaccount

SofarrightthisaccountisR=Revenueanddoesnotappearinexpenses

    
asked by anonymous 20.08.2015 / 15:32

1 answer

1

Denilson Carlos, try to take the increment of cbbConta.SelectedIndex +1.

  private void cbbConta_SelectedIndexChanged(object sender, EventArgs e)
{ 
    codContaSelec = cbbConta.SelectedIndex ;
   // codContaSelec = Convert.ToInt32(conta);
    CarregarSubContaCombo(codContaSelec);
}
    
20.08.2015 / 15:47