Example #1
0
        public void AtualizaTela()
        {
            if (modotela =="consulta")
            {
                groupCadastra.Visible = false;
                groupPesquisa.Visible = true;
                groupDetalhe.Visible = false;
            }

            else if (modotela =="alteracao")
            {
                groupCadastra.Visible = true;
                groupPesquisa.Visible = false;
                groupDetalhe.Visible = false;

                if (codCLienteJogar != 0)
                {
                    pClienteJogar cliente = new pClienteJogar();
                    DataSet retorno;

                    retorno = cliente.GetClientByCod(codCLienteJogar);

                    txtNome.Text = retorno.Tables[0].Rows[0]["Nome"].ToString();
                    txtRG.Text = retorno.Tables[0].Rows[0]["RG"].ToString();
                    txtEmail.Text = retorno.Tables[0].Rows[0]["Email"].ToString();
                    txtPSN.Text = retorno.Tables[0].Rows[0]["PSN"].ToString();
                    txtSenha.Text = retorno.Tables[0].Rows[0]["Senha"].ToString();
                    txtTelefone.Text = retorno.Tables[0].Rows[0]["Telefone"].ToString();
                    txtObs.Text = retorno.Tables[0].Rows[0]["Obs"].ToString();

                }
            }
            else if (modotela == "detalhe")
            {
                groupDetalhe.Visible = true;
                groupCadastra.Visible = false;
                groupPesquisa.Visible = false;

                DataSet retorno;
                pClienteJogarDivida _pdivida = new pClienteJogarDivida();

                retorno = _pdivida.GetDivida(codCLienteJogar);
                lblDivida.Text = retorno.Tables[0].Rows[0]["divida"].ToString();
            }
            else if (modotela == "cadastra")
            {
                groupCadastra.Visible = true;
                groupPesquisa.Visible = false;
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ClienteJogarDivida _div = new ClienteJogarDivida();

            _div.codClienteJogar = codClienteJogar;
            if (ddlTipo.SelectedItem == "Pagar")
            {
                _div.Valor = -Convert.ToDecimal(txtValor.Text);
            }
            else
            {
                _div.Valor = Convert.ToDecimal(txtValor.Text);
            }

            pClienteJogarDivida divida = new pClienteJogarDivida();
            divida.CadastrarDivida(_div);
            MessageBox.Show("Operação realizada com sucesso");
            this.Close();
        }