コード例 #1
0
        private void dgvCandidatos_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 8)
            {
                Model.MatriculaResponse matricula = dgvCandidatos.CurrentRow.DataBoundItem as Model.MatriculaResponse;

                DialogResult result = MessageBox.Show("Dejesa Remover?", "NSF", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    try
                    {
                        MatriculaApi.Deletar(matricula.aluno.IdAluno);
                        MessageBox.Show("Registro removido", "NSF", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        CarregarGrid();
                    }
                    catch (ArgumentException ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Ocorreu um erro", "error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            if (e.ColumnIndex == 7)
            {
                Model.MatriculaResponse matricula = dgvCandidatos.CurrentRow.DataBoundItem as Model.MatriculaResponse;

                frmMatriculaNovo tela = new frmMatriculaNovo();
                frmInicial.Current.OpenScreen(tela);
                tela.CarregarTela(matricula);


                Hide();
            }
        }
コード例 #2
0
        private void label19_Click(object sender, EventArgs e)
        {
            var tela = new frmMatriculaNovo();

            frmInicial.Current.OpenScreen(tela);
        }