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."); } }
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"; }
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(); }
private void btnRemover_Click(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); } dgvFuncionarios.DataSource = ""; dgvFuncionarios.DataSource = bllFun.Select(); limparControles(); }
private void btnAtualizar_Click(object sender, EventArgs e) { CAMADAS.BLL.Funcionarios bllFun = new CAMADAS.BLL.Funcionarios(); dgvFuncionarios.DataSource = ""; dgvFuncionarios.DataSource = bllFun.Select(); }
private void Funcionarios_Load(object sender, EventArgs e) { CAMADAS.BLL.Funcionarios bllFuncionario = new CAMADAS.BLL.Funcionarios(); dgvFuncionarios.DataSource = ""; dgvFuncionarios.DataSource = bllFuncionario.Select(); }