コード例 #1
0
ファイル: Calculadora.cs プロジェクト: AlanAds03/MaisGamers
        public void AtualizaTela()
        {
            if (modoTela == ModoTela.Consulta)
            {

                groupPesquisa.Visible = true;
                groupCadastro.Visible = false;
            }
            else if (modoTela == ModoTela.Cadastro)
            {
                groupPesquisa.Visible = false;
                groupCadastro.Visible = true;
                codJogo = 0;
            }
            else if (modoTela == ModoTela.Alteracao)
            {
                groupPesquisa.Visible = false;
                groupCadastro.Visible = true;


                if (codJogo != 0)
                {
                    pJogo jogo = new pJogo();
                    DataSet retorno;

                    retorno = jogo.GetJogoByCod(codJogo);

                    txtNome.Text = retorno.Tables[0].Rows[0]["Nome"].ToString();
                    ddlConsole.PosicionaCombo(Convert.ToInt32(retorno.Tables[0].Rows[0]["codConsole"]));
                    txtMidia.Text = retorno.Tables[0].Rows[0]["ValorFisica"].ToString();
                    txtPrimaria.Text = retorno.Tables[0].Rows[0]["Primaria"].ToString();
                    txtSecundária.Text = retorno.Tables[0].Rows[0]["Secundaria"].ToString();
                    txtQuantidade.Text = retorno.Tables[0].Rows[0]["Qtd"].ToString();


                }

            }
        }