Пример #1
0
 private void FormCadFornecedores_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F6)
     {
         if (btnConsultaGeral.Enabled)
         {
             LimparCampos();
             OrganizaBotoes();
             butAlterar.Enabled = false;
             FormGridFornecedores grid = new FormGridFornecedores(this, "fornecedores");
             grid.MdiParent = this.ParentForm;
             grid.Show();
         }
     }
     else if (e.KeyCode == Keys.Enter)
     {
         if (e.Shift)
         {
             e.SuppressKeyPress = true;
             SendKeys.Send("+{TAB}");
         }
         else
         {
             e.SuppressKeyPress = true;
             SendKeys.Send("{TAB}");
         }
     }
 }
Пример #2
0
        private void btnConsultaFornecedor_Click(object sender, EventArgs e)
        {
            tbCodigoFornecedor.Clear();
            tbNomeFornecedor.Clear();
            FormGridFornecedores grid = new FormGridFornecedores(this, "produtos");

            grid.MdiParent = this.ParentForm;
            grid.Show();
        }
Пример #3
0
 private void FormCadProdutos_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F6)
     {
         if (btnConsultaGeral.Enabled)
         {
             LimparCampos();
             OrganizaBotoes();
             butAlterar.Enabled = false;
             FormGridProdutos grid = new FormGridProdutos(this, "produtos");
             grid.MdiParent = this.ParentForm;
             grid.Show();
         }
         else if (tbCodigoFornecedor.Focused == true || tbNomeFornecedor.Focused == true)
         {
             tbCodigoFornecedor.Clear();
             tbNomeFornecedor.Clear();
             FormGridFornecedores grid = new FormGridFornecedores(this, "produtos");
             grid.MdiParent = this.ParentForm;
             grid.Show();
         }
     }
     else if (e.KeyCode == Keys.F2)
     {
         if (tbCodigoFornecedor.Focused == true || tbNomeFornecedor.Focused == true)
         {
             FormCadFornecedores cadForn = new FormCadFornecedores((FormPrincipal)this.MdiParent);
             cadForn.MdiParent = this.ParentForm;
             cadForn.Show();
         }
     }
     else if (e.KeyCode == Keys.F7)
     {
         if (tbCodigoProduto.Text.Length > 0 && tbDescProduto.Text.Length > 0)
         {
             FormCadCodBarras barcode = new FormCadCodBarras();
             barcode.IdProduto         = Convert.ToInt32(tbCodigoProduto.Text);
             barcode.gpbCodBarras.Text = tbDescProduto.Text;
             barcode.MdiParent         = this.ParentForm;
             barcode.Show();
         }
     }
     else if (e.KeyCode == Keys.Enter)
     {
         if (e.Shift)
         {
             e.SuppressKeyPress = true;
             SendKeys.Send("+{TAB}");
         }
         else
         {
             e.SuppressKeyPress = true;
             SendKeys.Send("{TAB}");
         }
     }
 }
Пример #4
0
        private void btnConsGeral_Click(object sender, EventArgs e)
        {
            LimparCampos();
            OrganizaBotoes();
            butAlterar.Enabled = false;
            FormGridFornecedores grid = new FormGridFornecedores(this, "fornecedores");

            grid.MdiParent = this.ParentForm;
            grid.Show();
        }
Пример #5
0
        private void butConsultar_Click(object sender, EventArgs e)
        {
            Fornecedor forn = new Fornecedor();

            if (tbCodigo.Text.Length == 0)
            {
                LimparCampos();
                OrganizaBotoes();
                butAlterar.Enabled = false;
                FormGridFornecedores grid = new FormGridFornecedores(this, "fornecedores");
                grid.MdiParent = this.ParentForm;
                grid.Show();
            }
            else
            {
                forn.IdFornecedor = Convert.ToInt32(tbCodigo.Text);
                forn.LocalizaFornecedor();
                if (forn.Cnpj != null)
                {
                    tbBairro.Text      = forn.Bairro;
                    tbCep.Text         = forn.Cep;
                    tbCidade.Text      = forn.Cidade;
                    tbCpfCnpj.Text     = forn.Cnpj;
                    tbEmail.Text       = forn.Email;
                    tbEndereco.Text    = forn.Endereco;
                    tbFantasia.Text    = forn.NomeFantasia;
                    tbIE.Text          = forn.Ie;
                    tbNumero.Text      = forn.Numero;
                    tbObs.Text         = forn.Obs;
                    tbRamal1.Text      = forn.Ramal1;
                    tbRamal2.Text      = forn.Ramal2;
                    tbRazaoSocial.Text = forn.RazaoSocial;
                    tbTel1.Text        = forn.Tel1;
                    tbTel2.Text        = forn.Tel2;
                    tbUF.Text          = forn.Uf;
                    butAlterar.Enabled = true;
                    butExcluir.Enabled = true;
                }
                else
                {
                    this.LimparCampos();
                    this.OrganizaBotoes();
                }
                tbCodigo.SelectAll();
            }
        }