Exemplo n.º 1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            Telas.Cadastros.FrmCadFuncionario fcu = new Cadastros.FrmCadFuncionario();
            fcu.Text         = "Alterando o funcionario";
            fcu.Codigo       = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value);
            fcu.txtNome.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value);
            if (Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value) == "f")
            {
                fcu.rbFem.Checked  = true;
                fcu.rbFem.Enabled  = false;
                fcu.rbMasc.Enabled = false;
            }
            else
            {
                fcu.rbMasc.Checked = true;
                fcu.rbMasc.Enabled = false;
                fcu.rbFem.Enabled  = false;
            }
            fcu.txtEmail.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value);
            fcu.txtCpf.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value);
            fcu.txtData.Text  = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value);
            fcu.txtCep.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[8].Value);
            fcu.BuscarEndereco(sender, e);
            fcu.txtNum.Text         = Convert.ToString(dataGridView1.CurrentRow.Cells[11].Value);
            fcu.txtComplemento.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[12].Value);

            fcu.button1.Text          = "Alterar";
            fcu.button1.Click        -= fcu.CadastrarFuncionario;
            fcu.button1.Click        += fcu.AlterarFuncionario;
            fcu.checkAtivo.Visible    = false;
            fcu.checkVendedor.Visible = false;
            fcu.ShowDialog();
        }
Exemplo n.º 2
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            Telas.Cadastros.FrmCadFuncionario fcu = new Cadastros.FrmCadFuncionario();
            fcu.Text         = "Detalhando 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;
                fcu.rbFem.Enabled  = false;
                fcu.rbMasc.Enabled = false;
            }
            else
            {
                fcu.rbMasc.Checked = true;
                fcu.rbMasc.Enabled = false;
                fcu.rbFem.Enabled  = false;
            }
            fcu.txtEmail.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value);
            fcu.txtCpf.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value);
            fcu.txtData.Text  = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value);
            fcu.txtCep.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[8].Value);
            fcu.BuscarEndereco(sender, e);
            fcu.txtNum.Text         = Convert.ToString(dataGridView1.CurrentRow.Cells[11].Value);
            fcu.txtComplemento.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[12].Value);



            fcu.checkAtivo.Visible      = false;
            fcu.checkVendedor.Visible   = false;
            fcu.button1.Visible         = false;
            fcu.txtNome.ReadOnly        = true;
            fcu.txtData.ReadOnly        = true;
            fcu.txtEnd.ReadOnly         = true;
            fcu.txtBairro.ReadOnly      = true;
            fcu.txtCidade.ReadOnly      = true;
            fcu.txtComplemento.ReadOnly = true;
            fcu.txtUF.ReadOnly          = true;
            fcu.txtCpf.ReadOnly         = true;
            //  fcu.txtTel.ReadOnly = true;
            fcu.txtEmail.ReadOnly = true;
            fcu.txtCep.ReadOnly   = true;
            fcu.txtNum.ReadOnly   = true;


            fcu.ShowDialog();
        }
 private void btnFunc_Click(object sender, EventArgs e)
 {
     Telas.Cadastros.FrmCadFuncionario n = new Cadastros.FrmCadFuncionario();
     n.ShowDialog();
 }