Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        public List <pFuncionario> SelFuncionario(string Cpf)
        {
            Dao                 D  = new Dao();
            DataTable           DT = D.SelFuncionario(Cpf);
            List <pFuncionario> LC = new List <pFuncionario>();

            for (int i = 0; i < DT.Rows.Count; i++)
            {
                pFuncionario P = new pFuncionario();
                P.Matr_Func    = Convert.ToInt32(DT.Rows[i]["Matr_Func"]);
                P.Nome         = DT.Rows[i]["Nome"].ToString();
                P.Rg           = DT.Rows[i]["Rg"].ToString();
                P.Cpf          = DT.Rows[i]["Cpf"].ToString();
                P.Telefone     = DT.Rows[i]["Telefone"].ToString();
                P.Email        = DT.Rows[i]["Email"].ToString();
                P.DtNascimento = Convert.ToDateTime(DT.Rows[i]["DTNascimento"]);
                P.Estado       = DT.Rows[i]["Estado"].ToString();
                P.Uf           = DT.Rows[i]["Uf"].ToString();
                P.Lougradouro  = DT.Rows[i]["Lougradouro"].ToString();
                P.Complemento  = DT.Rows[i]["Complemento"].ToString();
                P.Bairro       = DT.Rows[i]["Bairro"].ToString();
                P.Cep          = DT.Rows[i]["Cep"].ToString();
                P.Senha        = DT.Rows[i]["Senha"].ToString();
                P.Cargo        = DT.Rows[i]["Cargo"].ToString();
                LC.Add(P);
            }
            return(LC);
        }
Ejemplo n.º 3
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            if (txtData1.Text == string.Empty)
            {
                Msg("Selecione a data!");
                return;
            }
            else if (txtData2.Text == string.Empty)
            {
                Msg("Selecione a data!");
                return;
            }
            else
            {
                Data1           = Convert.ToDateTime(txtData1.Text);
                Data2           = Convert.ToDateTime(txtData2.Text);
                lblInicial.Text = Data1.ToString("dd/MM/yyyy");
                lblFinal.Text   = Data2.ToString("dd/MM/yyyy");
                mPedido      M   = new mPedido();
                pFuncionario K   = new pFuncionario();
                int          Cod = Convert.ToInt32(ddlFuncionario.SelectedValue);
                K.Matr_Func = Cod;
                List <pDataPedido> L1 = M.RelatorioVendaFunc(Dinheiro, Data1, Data2, Cod);
                List <pDataPedido> L2 = M.RelatorioVendaFunc(Debito, Data1, Data2, Cod);
                List <pDataPedido> L3 = M.RelatorioVendaFunc(Credito, Data1, Data2, Cod);
                gdvListaPecas1.DataSource = L1;
                gdvListaPecas1.DataBind();
                gdvListaPecas2.DataSource = L2;
                gdvListaPecas2.DataBind();
                gdvListaPecas3.DataSource = L3;
                gdvListaPecas3.DataBind();
                Codigo         = Codigo + gdvListaPecas1.Rows.Count;
                Codigo         = Codigo + gdvListaPecas2.Rows.Count;
                Codigo         = Codigo + gdvListaPecas3.Rows.Count;
                lblVendas.Text = Convert.ToString(Codigo);
                for (int i = 0; i < L1.Count; i++)
                {
                    Din = Din + L1[i].ValorTotal;
                }
                for (int i = 0; i < L2.Count; i++)
                {
                    Deb = Deb + L2[i].ValorTotal;
                }
                for (int i = 0; i < L3.Count; i++)
                {
                    Cre = Cre + L3[i].ValorTotal;
                }
                lblDinheiro.Text   = Din.ToString("C");
                lblDebito.Text     = Deb.ToString("C");
                lblCredito.Text    = Cre.ToString("C");
                lblTotalVenda.Text = (Din + Deb + Cre).ToString("C");

                RelVenda.Visible = true;
            }
        }
Ejemplo n.º 4
0
        public List <pFuncionario> SelFun()
        {
            Dao                 D  = new Dao();
            DataTable           DT = D.SelFun();
            List <pFuncionario> LC = new List <pFuncionario>();

            for (int i = 0; i < DT.Rows.Count; i++)
            {
                pFuncionario P = new pFuncionario();
                P.Matr_Func = Convert.ToInt32(DT.Rows[i]["Matr_Func"]);
                P.Nome      = DT.Rows[i]["Nome"].ToString();
                LC.Add(P);
            }
            return(LC);
        }
Ejemplo n.º 5
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 (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();
     }
 }
Ejemplo n.º 6
0
 public List<pFuncionario> Login(int Matr_Func, string Senha)
 {
     Dao D = new Dao();
     DataTable DT = D.Login(Matr_Func, Senha);
     List<pFuncionario> LC = new List<pFuncionario>();
     for (int i = 0; i < DT.Rows.Count; i++)
     {
         pFuncionario P = new pFuncionario();
         P.Matr_Func = Convert.ToInt32(DT.Rows[i]["Matr_Func"]);
         P.Nome = DT.Rows[i]["Nome"].ToString();
         P.Rg = DT.Rows[i]["Rg"].ToString();
         P.Cpf = DT.Rows[i]["Cpf"].ToString();
         P.Telefone = DT.Rows[i]["Telefone"].ToString();
         P.Email = DT.Rows[i]["Email"].ToString();
         P.DtNascimento = Convert.ToDateTime(DT.Rows[i]["DTNascimento"]);
         P.Estado = DT.Rows[i]["Estado"].ToString();
         P.Uf = DT.Rows[i]["Uf"].ToString();
         P.Lougradouro = DT.Rows[i]["Lougradouro"].ToString();
         P.Complemento = DT.Rows[i]["Complemento"].ToString();
         P.Bairro = DT.Rows[i]["Bairro"].ToString();
         P.Cep = DT.Rows[i]["Cep"].ToString();
         P.Senha = DT.Rows[i]["Senha"].ToString();
         P.Cargo = DT.Rows[i]["Cargo"].ToString();
         LC.Add(P);
     }
     return LC;
 }
Ejemplo n.º 7
0
 public List<pFuncionario> SelFun()
 {
     Dao D = new Dao();
     DataTable DT = D.SelFun();
     List<pFuncionario> LC = new List<pFuncionario>();
     for (int i = 0; i < DT.Rows.Count; i++)
     {
         pFuncionario P = new pFuncionario();
         P.Matr_Func = Convert.ToInt32(DT.Rows[i]["Matr_Func"]);
         P.Nome = DT.Rows[i]["Nome"].ToString();
         LC.Add(P);
     }
     return LC;
 }
Ejemplo n.º 8
0
        public void InsFuncionario(pFuncionario P)
        {
            Dao D = new Dao();

            D.InsFuncionario(P.Nome, P.Rg, P.Cpf, P.Telefone, P.Email, P.DtNascimento, P.Estado, P.Uf, P.Lougradouro, P.Complemento, P.Bairro, P.Cep, P.Senha, P.Cargo);
        }
Ejemplo n.º 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 (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();
     }
 }
Ejemplo n.º 10
0
        public void AtuFuncionario(pFuncionario P)
        {
            Dao D = new Dao();

            D.AtuFuncionario(P.Nome, P.Rg, P.Cpf, P.Telefone, P.Email, P.DtNascimento, P.Estado, P.Uf, P.Lougradouro, P.Complemento, P.Bairro, P.Cep, P.Senha, P.Cargo);
        }