Пример #1
0
        private void ConsultarFuncionario(Object o, EventArgs e)
        {
            try
            {
                Telas.Cadastrar.FrmFuncionario fcu = new Cadastrar.FrmFuncionario();
                fcu.label1.Text  = "Consultando o Funcionário";
                fcu.txtNome.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value);
                if (Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value) == "f")
                {
                    fcu.rbFem.Checked = true;
                }
                else
                {
                    fcu.rbMasc.Checked = true;
                }
                fcu.txtData.Text        = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value);
                fcu.txtCPF.Text         = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value);
                fcu.txtRg.Text          = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value);
                fcu.txtCEP.Text         = Convert.ToString(dataGridView1.CurrentRow.Cells[6].Value);
                fcu.txtNumero.Text      = Convert.ToString(dataGridView1.CurrentRow.Cells[7].Value);
                fcu.txtComplemento.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[8].Value);
                fcu.txtEmail.Text       = Convert.ToString(dataGridView1.CurrentRow.Cells[9].Value);
                fcu.txtTelefone.Text    = Convert.ToString(dataGridView1.CurrentRow.Cells[10].Value);
                //fcu..Text = Convert.ToString(dataGridView1.CurrentRow.Cells[11].Value);
                fcu.txtSalario.Text       = Convert.ToString(dataGridView1.CurrentRow.Cells[12].Value);
                fcu.cbCargo.SelectedValue = Convert.ToString(dataGridView1.CurrentRow.Cells[13].Value);
                fcu.txtDataAdm.Text       = Convert.ToString(dataGridView1.CurrentRow.Cells[14].Value);

                fcu.txtNome.ReadOnly        = true;
                fcu.rbMasc.Enabled          = false;
                fcu.rbFem.Enabled           = false;
                fcu.txtCPF.ReadOnly         = true;
                fcu.txtRg.ReadOnly          = true;
                fcu.txtCEP.ReadOnly         = true;
                fcu.txtNumero.ReadOnly      = true;
                fcu.txtComplemento.ReadOnly = true;
                fcu.txtEmail.ReadOnly       = true;
                fcu.txtTelefone.ReadOnly    = true;
                fcu.txtSalario.ReadOnly     = true;
                fcu.cbCargo.Enabled         = false;
                fcu.txtDataAdm.ReadOnly     = true;
                fcu.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                //throw;
            }
        }
Пример #2
0
        private void ConsultarFuncionario(Object o, EventArgs e)
        {
            try
            {
                Telas.Cadastrar.FrmFuncionario fcu = new Cadastrar.FrmFuncionario();
                fcu.pcbFoto.Click -= fcu.SalvarFoto;
                fcu.label1.Text    = "Consultando o Funcionário";
                fcu.txtNome.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value);
                if (Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value) == "f")
                {
                    fcu.rbFem.Checked = true;
                }
                else
                {
                    fcu.rbMasc.Checked = true;
                }
                fcu.txtData.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value);
                fcu.txtCPF.Text    = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value);
                fcu.txtRg.Text     = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value);
                fcu.txtCEP.Text    = Convert.ToString(dataGridView1.CurrentRow.Cells[6].Value);
                fcu.txtNumero.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[7].Value);

                fcu.BuscarEndereco(o, e);

                fcu.txtComplemento.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[8].Value);
                fcu.txtEmail.Text       = Convert.ToString(dataGridView1.CurrentRow.Cells[9].Value);
                fcu.txtTelefone.Text    = Convert.ToString(dataGridView1.CurrentRow.Cells[10].Value);
                if (Convert.ToString(dataGridView1.CurrentRow.Cells[11].Value) != "")
                {
                    fcu.imagem = Convert.ToString(dataGridView1.CurrentRow.Cells[11].Value);
                    fcu.pcbFoto.ImageLocation = fcu.imagem;
                    fcu.pcbFoto.SizeMode      = PictureBoxSizeMode.StretchImage;


                    //fcu.pcbFoto.Image.Width = 140;
                }
                else
                {
                    fcu.pcbFoto.ImageLocation = Application.StartupPath.ToString() + "\\FotosFuncionarios\\semimagem.png";
                }

                fcu.txtSalario.Text       = Convert.ToString(dataGridView1.CurrentRow.Cells[12].Value);
                fcu.cbCargo.SelectedValue = Convert.ToString(dataGridView1.CurrentRow.Cells[13].Value);
                fcu.txtDataAdm.Text       = Convert.ToString(dataGridView1.CurrentRow.Cells[14].Value);

                fcu.txtNome.ReadOnly        = true;
                fcu.rbMasc.Enabled          = false;
                fcu.rbFem.Enabled           = false;
                fcu.txtCPF.ReadOnly         = true;
                fcu.txtRg.ReadOnly          = true;
                fcu.txtCEP.ReadOnly         = true;
                fcu.txtNumero.ReadOnly      = true;
                fcu.txtComplemento.ReadOnly = true;
                fcu.txtEmail.ReadOnly       = true;
                fcu.txtTelefone.ReadOnly    = true;
                fcu.txtSalario.ReadOnly     = true;
                fcu.cbCargo.Enabled         = false;
                fcu.txtDataAdm.ReadOnly     = true;
                fcu.btnAceitar.Visible      = false;
                fcu.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                //throw;
            }
        }
Пример #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     Telas.Cadastrar.FrmFuncionario f = new Cadastrar.FrmFuncionario();
     f.ShowDialog();
 }
 private void pictureBox6_Click(object sender, EventArgs e)
 {
     Cadastrar.FrmFuncionario f = new Cadastrar.FrmFuncionario();
     f.ShowDialog();
 }