Beispiel #1
0
        private void btnFuncionario_Click(object sender, EventArgs e)
        {
            FFFuncionario frm             = new FFFuncionario(AcaoNaTela.Cadastrar);
            DialogResult  dialogResultado = frm.ShowDialog();

            if (dialogResultado == DialogResult.Yes)
            {
                ListarFuncionario();
            }
        }
Beispiel #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount == 0)
            {
                FNotificao.AlerForm(" Nenhum Selecionado", TipoNotificacao.aviso);
            }
            else
            {
                string result = FNotificao.AlertConfirm("Deseja Editar os dados do Funcionário #" +
                                                        dgv.CurrentRow.Cells["NomeCompleto"].Value.ToString() + "# ?", TipoNotificacao.pergunta);
                if (result.Equals("1"))
                {
                    FFFuncionario frm = new FFFuncionario(AcaoNaTela.Editar);
                    frm.txtCodigo.Text   = dgv.CurrentRow.Cells["FuncionarioId"].Value.ToString();
                    frm.txtNome.Text     = dgv.CurrentRow.Cells["NomeCompleto"].Value.ToString();
                    frm.txtUsername.Text = dgv.CurrentRow.Cells["NomeUsuario"].Value.ToString();
                    frm.txtTelf.Text     = dgv.CurrentRow.Cells["Telf"].Value.ToString();
                    frm.txtEmail.Text    = dgv.CurrentRow.Cells["Email"].Value.ToString();
                    frm.txtEndereco.Text = dgv.CurrentRow.Cells["Endereco"].Value.ToString();

                    if (dgv.CurrentRow.Cells["Cargo"].Value.ToString() == "Gerente")
                    {
                        frm.cbCargo.SelectedIndex = 1;
                    }
                    else
                    {
                        frm.cbCargo.SelectedIndex = 2;
                    }

                    if (dgv.CurrentRow.Cells["Estado"].Value.ToString() == "Activo")
                    {
                        frm.cbEstado.SelectedIndex = 1;
                    }
                    else
                    {
                        frm.cbEstado.SelectedIndex = 2;
                    }

                    DialogResult DialogResult = frm.ShowDialog();
                    if (DialogResult == DialogResult.Yes)
                    {
                        ListarFuncionario();
                    }
                }
            }
        }