private void btNovoFuncionario_Click(object sender, EventArgs e) { ((Form)this.TopLevelControl).Hide(); frmFuncionarioConf fu = new frmFuncionarioConf(); fu.Show(); }
private void btEditar_Click(object sender, EventArgs e) { if (dgvFuncionarios.CurrentRow.Cells[0].Value != null) { List <string> campos = new List <string>(); campos.Add(dgvFuncionarios.CurrentRow.Cells[0].Value.ToString()); campos.Add(dgvFuncionarios.CurrentRow.Cells[1].Value.ToString()); campos.Add(dgvFuncionarios.CurrentRow.Cells[2].Value.ToString()); var sexo = dgvFuncionarios.CurrentRow.Cells[3].Value.ToString().Substring(0, 1); campos.Add(sexo.ToLower()); ((Form)this.TopLevelControl).Hide(); frmFuncionarioConf ff = new frmFuncionarioConf(campos, "editar"); ff.Show(); } else { MessageBox.Show("Escolha um registro para editar."); } }