Exemple #1
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            Codigo();
            string              Cpf = txtBuscaCpf.Text;
            mFuncionario        M   = new mFuncionario();
            List <pFuncionario> Lc  = M.SelFuncionario(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;
                txtSenha.Text        = Lc[0].Senha;
                ddlCargo.Text        = Lc[0].Cargo;
                txtCodFunc.Text      = Lc[0].Matr_Func.ToString();
                lblMatr_Func.Text    = Lc[0].Matr_Func.ToString();
            }
        }
Exemple #2
0
        protected void btnAlterar_Click(object sender, EventArgs e)
        {
            Msg("Funcionario alterado com sucesso !");
            string       Cpf = txtBuscaCpf.Text;
            pFuncionario P   = new pFuncionario();

            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;
            P.Senha        = txtSenha.Text;
            P.Cargo        = ddlCargo.Text;
            mFuncionario M = new mFuncionario();

            M.AtuFuncionario(P);
            LimparContatos();
        }
Exemple #3
0
        protected void btnExcluir_Click(object sender, EventArgs e)
        {
            Msg("Funcionário excluido com sucesso !");
            string       Cpf = txtBuscaCpf.Text;
            mFuncionario M   = new mFuncionario();

            M.ExcFuncionario(Cpf);
            LimparContatos();
        }
Exemple #4
0
        public void ListaFuncionario()
        {
            mFuncionario        M  = new mFuncionario();
            List <pFuncionario> Lc = M.SelFun();

            ddlFuncionario.DataTextField  = "Nome";
            ddlFuncionario.DataValueField = "Matr_Func";
            ddlFuncionario.DataSource     = Lc;
            ddlFuncionario.DataBind();
        }
 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 (txtSenha.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtSenha.Focus();
         return;
     }
     else
     {
         Msg("Funcionario cadastrado com sucesso!");
         pFuncionario P = new pFuncionario();
         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;
         P.Senha        = txtSenha.Text;
         P.Cargo        = ddlCargo.Text;
         mFuncionario M = new mFuncionario();
         M.InsFuncionario(P);
         LimparContatos();
     }
 }
 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 (txtSenha.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtSenha.Focus();
         return;
     }
     else
     {
         Msg("Funcionario cadastrado com sucesso!");
         pFuncionario P = new pFuncionario();
         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;
         P.Senha = txtSenha.Text;
         P.Cargo = ddlCargo.Text;
         mFuncionario M = new mFuncionario();
         M.InsFuncionario(P);
         LimparContatos();
     }
 }