Пример #1
0
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     Codigo();
     string Cpf = txtBuscaCpf.Text;
     mCliente M = new mCliente();
     List<pCliente> Lc = M.SelCliente(Cpf);
     if (Lc.Count == 0)
     {
         Msg("Cpf Inválido");
         return;
     }
     else
     {
         txtNome.Text = Lc[0].Nome;
         txtRg.Text = Lc[0].Rg;
         txtCpf.Text = Lc[0].Cpf;
         txtTelefone.Text = Lc[0].Telefone;
         txtEmail.Text = Lc[0].Email;
         txtDtNascimento.Text = Lc[0].DtNascimento.ToString("dd/MM/yyyy");
         txtEstado.Text = Lc[0].Estado;
         txtUf.Text = Lc[0].Uf;
         txtLougradouro.Text = Lc[0].Lougradouro;
         txtComplemento.Text = Lc[0].Complemento;
         txtBairro.Text = Lc[0].Bairro;
         txtCep.Text = Lc[0].Cep;
         lblCodCliente.Text = Lc[0].Cod_Cliente.ToString();
     }
 }
Пример #2
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            Codigo();
            string          Cpf = txtBuscaCpf.Text;
            mCliente        M   = new mCliente();
            List <pCliente> Lc  = M.SelCliente(Cpf);

            if (Lc.Count == 0)
            {
                Msg("Cpf Inválido");
                return;
            }
            else
            {
                txtNome.Text         = Lc[0].Nome;
                txtRg.Text           = Lc[0].Rg;
                txtCpf.Text          = Lc[0].Cpf;
                txtTelefone.Text     = Lc[0].Telefone;
                txtEmail.Text        = Lc[0].Email;
                txtDtNascimento.Text = Lc[0].DtNascimento.ToString("dd/MM/yyyy");
                txtEstado.Text       = Lc[0].Estado;
                txtUf.Text           = Lc[0].Uf;
                txtLougradouro.Text  = Lc[0].Lougradouro;
                txtComplemento.Text  = Lc[0].Complemento;
                txtBairro.Text       = Lc[0].Bairro;
                txtCep.Text          = Lc[0].Cep;
                lblCodCliente.Text   = Lc[0].Cod_Cliente.ToString();
            }
        }
Пример #3
0
 protected void btnExcluir_Click(object sender, EventArgs e)
 {
     string Cpf = txtBuscaCpf.Text;
     mCliente M = new mCliente();
     M.ExcCliente(Cpf);
     LimparContatos();
     Msg("Excluido com sucesso!");
 }
Пример #4
0
        protected void btnExcluir_Click(object sender, EventArgs e)
        {
            string   Cpf = txtBuscaCpf.Text;
            mCliente M   = new mCliente();

            M.ExcCliente(Cpf);
            LimparContatos();
            Msg("Excluido com sucesso!");
        }
Пример #5
0
 //public void Ddl()
 //{
 //    lblddl.Text = "0";
 //    lblddl.Text = ddlCliente.SelectedValue;
 //}
 public void ListaFornecedor()
 {
     mCliente M = new mCliente();
     List<pCliente> Lc = M.SelCliente();
     ddlCliente.DataTextField = "Nome";
     ddlCliente.DataValueField = "Cod_Cliente";
     ddlCliente.DataSource = Lc;
     ddlCliente.DataBind();
 }
Пример #6
0
        //public void Ddl()
        //{
        //    lblddl.Text = "0";
        //    lblddl.Text = ddlCliente.SelectedValue;
        //}
        public void ListaFornecedor()
        {
            mCliente        M  = new mCliente();
            List <pCliente> Lc = M.SelCliente();

            ddlCliente.DataTextField  = "Nome";
            ddlCliente.DataValueField = "Cod_Cliente";
            ddlCliente.DataSource     = Lc;
            ddlCliente.DataBind();
        }
Пример #7
0
 protected void btnAlterar_Click(object sender, EventArgs e)
 {
     Msg("Cadastro alterado com sucesso!");
     string Cpf = txtBuscaCpf.Text;
     pCliente P = new pCliente();
     P.Nome = txtNome.Text;
     P.Rg = txtRg.Text;
     P.Cpf = txtCpf.Text;
     P.Telefone = txtTelefone.Text;
     P.Email = txtEmail.Text;
     P.DtNascimento = Convert.ToDateTime(txtDtNascimento.Text);
     P.Estado = txtEstado.Text;
     P.Uf = txtUf.Text;
     P.Lougradouro = txtLougradouro.Text;
     P.Complemento = txtComplemento.Text;
     P.Bairro = txtBairro.Text;
     P.Cep = txtCep.Text;
     mCliente M = new mCliente();
     M.AtuCliente(P);
     LimparContatos();
 }
Пример #8
0
        protected void btnAlterar_Click(object sender, EventArgs e)
        {
            Msg("Cadastro alterado com sucesso!");
            string   Cpf = txtBuscaCpf.Text;
            pCliente P   = new pCliente();

            P.Nome         = txtNome.Text;
            P.Rg           = txtRg.Text;
            P.Cpf          = txtCpf.Text;
            P.Telefone     = txtTelefone.Text;
            P.Email        = txtEmail.Text;
            P.DtNascimento = Convert.ToDateTime(txtDtNascimento.Text);
            P.Estado       = txtEstado.Text;
            P.Uf           = txtUf.Text;
            P.Lougradouro  = txtLougradouro.Text;
            P.Complemento  = txtComplemento.Text;
            P.Bairro       = txtBairro.Text;
            P.Cep          = txtCep.Text;
            mCliente M = new mCliente();

            M.AtuCliente(P);
            LimparContatos();
        }
Пример #9
0
 protected void btnEnviar_Click(object sender, EventArgs e)
 {
     if (txtNome.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtNome.Focus();
         return;
     }
     else if (txtRg.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtRg.Focus();
         return;
     }
     else if (txtCpf.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtCpf.Focus();
         return;
     }
     else if (txtTelefone.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtTelefone.Focus();
         return;
     }
     else if (txtEmail.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtEmail.Focus();
         return;
     }
     else if (txtDtNascimento.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtDtNascimento.Focus();
         return;
     }
     else if (txtEstado.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtEstado.Focus();
         return;
     }
     else if (txtUf.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtUf.Focus();
         return;
     }
     else if (txtLougradouro.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtLougradouro.Focus();
         return;
     }
     else if (txtComplemento.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtComplemento.Focus();
         return;
     }
     else if (txtBairro.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtBairro.Focus();
         return;
     }
     else if (txtCep.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtCep.Focus();
         return;
     }
     else if (ValidaCPF.IsCpf(txtCpf.Text))
     {
         Msg("Cadastrado Com Sucesso!");
         pCliente P = new pCliente();
         P.Nome         = txtNome.Text;
         P.Rg           = txtRg.Text;
         P.Cpf          = txtCpf.Text;
         P.Telefone     = txtTelefone.Text;
         P.Email        = txtEmail.Text;
         P.DtNascimento = Convert.ToDateTime(txtDtNascimento.Text);
         P.Estado       = txtEstado.Text;
         P.Uf           = txtUf.Text;
         P.Lougradouro  = txtLougradouro.Text;
         P.Complemento  = txtComplemento.Text;
         P.Bairro       = txtBairro.Text;
         P.Cep          = txtCep.Text;
         mCliente M = new mCliente();
         M.InsCliente(P);
         LimparContatos();
     }
     else
     {
         Msg("O número é um CPF Inválido !");
     }
 }
Пример #10
0
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            if (txtNome.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtNome.Focus();
                return;
            }
            else if (txtRg.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtRg.Focus();
                return;
            }
            else if (txtCpf.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtCpf.Focus();
                return;
            }
            else if (txtTelefone.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtTelefone.Focus();
                return;
            }
            else if (txtEmail.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtEmail.Focus();
                return;
            }
            else if (txtDtNascimento.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtDtNascimento.Focus();
                return;
            }
            else if (txtEstado.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtEstado.Focus();
                return;
            }
            else if (txtUf.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtUf.Focus();
                return;
            }
            else if (txtLougradouro.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtLougradouro.Focus();
                return;
            }
            else if (txtComplemento.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtComplemento.Focus();
                return;
            }
            else if (txtBairro.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtBairro.Focus();
                return;
            }
            else if (txtCep.Text == string.Empty)
            {
                Msg("Campo obrigatório em branco!");
                txtCep.Focus();
                return;
            }
            else if (ValidaCPF.IsCpf(txtCpf.Text))
            {

                Msg("Cadastrado Com Sucesso!");
                pCliente P = new pCliente();
                P.Nome = txtNome.Text;
                P.Rg = txtRg.Text;
                P.Cpf = txtCpf.Text;
                P.Telefone = txtTelefone.Text;
                P.Email = txtEmail.Text;
                P.DtNascimento = Convert.ToDateTime(txtDtNascimento.Text);
                P.Estado = txtEstado.Text;
                P.Uf = txtUf.Text;
                P.Lougradouro = txtLougradouro.Text;
                P.Complemento = txtComplemento.Text;
                P.Bairro = txtBairro.Text;
                P.Cep = txtCep.Text;
                mCliente M = new mCliente();
                M.InsCliente(P);
                LimparContatos();
            }
            else
            {
                Msg("O número é um CPF Inválido !");

            }
        }