Example #1
0
        private void Visualizar()
        {
            FormProfessor frmProfessor = new FormProfessor();

            frmProfessor.SetOperacao(TipoOperacaoCadastro.Visualizar, GetIdItemSelecionado(lstProfessores));

            frmProfessor.ShowDialog(this);
        }
Example #2
0
        private void Excluir()
        {
            FormProfessor frmProfessor = new FormProfessor();

            Professor professor = null;

            frmProfessor.SetOperacao(TipoOperacaoCadastro.Excluir, GetIdItemSelecionado(lstProfessores));

            frmProfessor.SetEventRetorno(new EventHandler <Professor>(delegate(Object o, Professor a)
            {
                professor = a;
            }));

            frmProfessor.ShowDialog(this);

            if (professor != null)
            {
                RemoveItemSelecionado(lstProfessores);
            }
        }
Example #3
0
        private void Incluir()
        {
            FormProfessor frmProfessor = new FormProfessor();

            Professor professor = null;

            frmProfessor.SetOperacao(TipoOperacaoCadastro.Incluir, 0);

            frmProfessor.SetEventRetorno(new EventHandler <Professor>(delegate(Object o, Professor a)
            {
                professor = a;
            }));

            frmProfessor.ShowDialog(this);

            if (professor != null)
            {
                lstProfessores.BeginUpdate();

                IncluirNovoItem(professor);

                lstProfessores.EndUpdate();
            }
        }