示例#1
0
        private void Vendas_Load(object sender, EventArgs e)
        {
            txtBusca.Focus();
            //PEGAR DES_PRODUTO E ID
            CAMADAS.BLL.Produtos bllProdutos = new CAMADAS.BLL.Produtos();
            dgvProdutos.DataSource   = "";
            dgvProdutos.DataSource   = bllProdutos.SelectWithCategoria();
            txtIdProduto.Text        = dgvProdutos.SelectedRows[0].Cells["id_produto"].Value.ToString();
            txtValorUni.Text         = dgvProdutos.SelectedRows[0].Cells["valor"].Value.ToString();
            cmbProduto.DisplayMember = "desc_produto";
            cmbProduto.ValueMember   = "id_produto";

            cmbProduto.DataSource = bllProdutos.Select();


            CAMADAS.BLL.Funcionarios dalVend      = new CAMADAS.BLL.Funcionarios();
            CAMADAS.BLL.Clientes     dalCli       = new CAMADAS.BLL.Clientes();
            CAMADAS.BLL.TipoVenda    dalTipoVenda = new CAMADAS.BLL.TipoVenda();

            cmbVendedor.DisplayMember  = "nome_vendedor";
            cmbVendedor.ValueMember    = "id_vendedor";
            cmbCliente.DisplayMember   = "nome";
            cmbCliente.ValueMember     = "id_cliente";
            cmbTipoVenda.DisplayMember = "desc_tipo_venda";
            cmbTipoVenda.ValueMember   = "id_tipo_venda";


            cmbCliente.DataSource   = dalCli.Select();
            cmbVendedor.DataSource  = dalVend.Select();
            cmbTipoVenda.DataSource = dalTipoVenda.Select();
            txtDesconto.Text        = "0";
            txtQtd.Text             = "1";
        }
示例#2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (txtID.Text != "-1" && txtNome.Text != "" && txtEndereco.Text != "" && txtNumero.Text != "" && txtCidade.Text != "" && txtEmail.Text != "")
            {
                CAMADAS.MODEL.Funcionarios funcionario    = new CAMADAS.MODEL.Funcionarios();
                CAMADAS.BLL.Funcionarios   bllFuncionario = new CAMADAS.BLL.Funcionarios();

                funcionario.id_vendedor   = Convert.ToInt32(txtID.Text);
                funcionario.nome_vendedor = txtNome.Text;
                funcionario.endereco      = txtEndereco.Text;
                funcionario.numero        = Convert.ToInt32(txtNumero.Text);
                funcionario.cidade        = txtCidade.Text;
                funcionario.email         = txtEmail.Text;
                //funcionario.usuario = txtUsuario.Text;
                //funcionario.senha = txtSenha.Text;


                bllFuncionario.Update(funcionario);
                dgvFuncionarios.DataSource = "";
                dgvFuncionarios.DataSource = bllFuncionario.Select();
                limparControles();
            }
            else
            {
                MessageBox.Show("É necessário preencher todos os campos.");
            }
        }
示例#3
0
 private void Funcionarios_Load(object sender, EventArgs e)
 {
     limparControles();
     CAMADAS.BLL.Funcionarios bllFuncionario = new CAMADAS.BLL.Funcionarios();
     dgvFuncionarios.DataSource = "";
     dgvFuncionarios.DataSource = bllFuncionario.Select();
     txtNome.Focus();
 }
示例#4
0
        private void btnRemover_Click_1(object sender, EventArgs e)
        {
            int idFun = Convert.ToInt32(txtID.Text);

            CAMADAS.BLL.Funcionarios bllFun = new CAMADAS.BLL.Funcionarios();
            string       msg  = "Deseja remover o funcionário selecionado ?";
            DialogResult resp = MessageBox.Show(msg, "Remover", MessageBoxButtons.YesNo, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button2);

            if (resp == DialogResult.Yes)
            {
                bllFun.Delete(idFun);
            }

            limparControles();
        }
示例#5
0
        private void btnGravar_Click_1(object sender, EventArgs e)
        {
            CAMADAS.MODEL.Funcionarios funcionario     = new CAMADAS.MODEL.Funcionarios();
            CAMADAS.BLL.Funcionarios   bllFuncionarios = new CAMADAS.BLL.Funcionarios();
            if (txtID.Text == "-1" && txtNome.Text != "" && txtEndereco.Text !=
                "" && txtNumero.Text != "" && txtCidade.Text != "" && txtEmail.Text != "")
            {
                //funcionario.usuario = txtUsuario.Text;
                //funcionario.senha = txtSenha.Text;
                funcionario.nome_vendedor = txtNome.Text;
                funcionario.endereco      = txtEndereco.Text;
                funcionario.numero        = Convert.ToInt32(txtNumero.Text);
                funcionario.cidade        = txtCidade.Text;
                funcionario.email         = txtEmail.Text;


                bllFuncionarios.Insert(funcionario);
                limparControles();
            }
            else
            {
                MessageBox.Show("É necessário preencher todos os campos.");
            }
        }
示例#6
0
 private void btnAtualizar_Click(object sender, EventArgs e)
 {
     CAMADAS.BLL.Funcionarios bllFun = new CAMADAS.BLL.Funcionarios();
     dgvFuncionarios.DataSource = "";
     dgvFuncionarios.DataSource = bllFun.Select();
 }
示例#7
0
 private void Funcionarios_Load(object sender, EventArgs e)
 {
     CAMADAS.BLL.Funcionarios bllFuncionario = new CAMADAS.BLL.Funcionarios();
     dgvFuncionarios.DataSource = "";
     dgvFuncionarios.DataSource = bllFuncionario.Select();
 }