Example #1
0
 private void FormCadFuncionarios_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F6)
     {
         if (btnConsultaGeral.Enabled)
         {
             LimparCampos();
             OrganizaBotoes();
             butAlterar.Enabled = false;
             FormGridFuncionarios grid = new FormGridFuncionarios(this);
             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}");
         }
     }
 }
Example #2
0
        private void butConsultar_Click(object sender, EventArgs e)
        {
            if (tbCodigoFuncionario.Text.Length == 0)
            {
                LimparCampos();
                OrganizaBotoes();
                butAlterar.Enabled = false;
                FormGridFuncionarios grid = new FormGridFuncionarios(this);
                grid.MdiParent = this.ParentForm;
                grid.Show();
            }
            else
            {
                func    = new Funcionario();
                func.Id = Convert.ToInt32(tbCodigoFuncionario.Text);
                func.ConsultarMecanico();
                if (func.Nome != null)
                {
                    dt = new DataTable();
                    Funcao fun = new Funcao();
                    fun.Id = func.IdFuncao;
                    fun.ConsultaFuncao();

                    //Preenche ComboBox
                    dt = new DataTable();
                    dt = fun.PreencherCbx();
                    cbxFuncao.DisplayMember = "descricao";
                    cbxFuncao.ValueMember   = "id";
                    cbxFuncao.DataSource    = dt;
                    cbxFuncao.Text          = fun.Descricao;

                    tbBairro.Text     = func.Bairro;
                    tbCelular.Text    = func.Celular;
                    tbCep.Text        = func.Cep;
                    tbCidade.Text     = func.Cidade;
                    tbCpfCnpj.Text    = func.Cpf;
                    dtAdmissao.Text   = Convert.ToString(func.Dataadmi);
                    dtNascimento.Text = Convert.ToString(func.Datanasc);
                    tbEndereco.Text   = func.Logradouro;
                    tbEstado.Text     = func.Estado;
                    tbNome.Text       = func.Nome;
                    tbNumero.Text     = func.Numero;
                    tbRgIe.Text       = func.Rg;
                    tbSalario.Text    = Convert.ToString(func.Salario);
                    tbTelefone1.Text  = func.Telefone;

                    butAlterar.Enabled = true;
                    butExcluir.Enabled = true;
                    tbCodigoFuncionario.Focus();
                    tbCodigoFuncionario.SelectAll();
                }
                else
                {
                }
            }
        }
Example #3
0
        private void btnConsultaGeral_Click(object sender, EventArgs e)
        {
            LimparCampos();
            OrganizaBotoes();
            butAlterar.Enabled = false;
            FormGridFuncionarios grid = new FormGridFuncionarios(this);

            grid.MdiParent = this.ParentForm;
            grid.Show();
        }