Пример #1
0
        public Form1()
        {
            InitializeComponent();
            Docente dc = new Docente();

            dc.SetUser("admin");
            dc.SetPass("1234");

            dc.SetNome("Administrador");
            RD.GetListaPessoa().Add(dc);

            Aluno al = new Aluno();

            al.SetUser("aluno");
            al.SetPass("aluno");

            al.SetNome("Aluno");
            RD.GetListaPessoa().Add(al);

            OrientadorEmpresa oe = new OrientadorEmpresa();

            oe.SetUser("orientador");
            oe.SetPass("orientador");

            oe.SetNome("Orientador");
            RD.GetListaPessoa().Add(oe);

            Empresa e = new Empresa();

            e.SetUser("empresa");
            e.SetPass("empresa");

            e.SetNome("Empresa");
            RD.GetListaEmpresa().Add(e);
        }
Пример #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            switch (cb_tipoUtilizador.Text)
            {
            case "Aluno":
                foreach (Aluno A in RD.GetListaPessoa().OfType <Aluno>())
                {
                    if (A.GetUser() == txt_username.Text && A.GetPass() == txt_Password.Text)
                    {
                        RD.SetLogin(A.GetNome());
                        this.DialogResult = DialogResult.Yes;
                    }
                }
                break;

            case "Docente":
                foreach (Docente D in RD.GetListaPessoa().OfType <Docente>())
                {
                    if (D.GetUser() == txt_username.Text && D.GetPass() == txt_Password.Text)
                    {
                        RD.SetLogin(D.GetNome());
                        this.DialogResult = DialogResult.Yes;
                    }
                }
                break;

            case "Orientador":
                foreach (OrientadorEmpresa OE in RD.GetListaPessoa().OfType <OrientadorEmpresa>())
                {
                    if (OE.GetUser() == txt_username.Text && OE.GetPass() == txt_Password.Text)
                    {
                        RD.SetLogin(OE.GetNome());
                        this.DialogResult = DialogResult.Yes;
                    }
                }
                break;

            case "Empresa":
                foreach (Empresa EM in RD.GetListaEmpresa())
                {
                    if (EM.GetUser() == txt_username.Text && EM.GetPass() == txt_Password.Text)
                    {
                        RD.SetLogin(EM.GetNome());
                        this.DialogResult = DialogResult.Yes;
                    }
                }
                break;
            }
        }
Пример #3
0
 private void bt_pesquisar_Click_1(object sender, EventArgs e)
 {
     foreach (Docente PE in DE.GetListaPessoa().OfType <Docente>())
     {
         if (PE.GetNDocente() == Convert.ToInt32(txt_numero.Text))
         {
             lb_erro.Visible = false;
             lb_nome.Text    = PE.GetNome();
         }
         else
         {
             lb_nome.Visible = false;
         }
     } //FIM FOREACH
 }     //FIM BOTÃO
Пример #4
0
 private void bt_pesquisar_Click_1(object sender, EventArgs e)
 {
     foreach (OrientadorEmpresa DP in DE.GetListaPessoa().OfType <OrientadorEmpresa>())
     {
         if (DP.GetNumOrientador() == Convert.ToInt32(txt_numero.Text))
         {
             lb_erro.Visible = false;
             lb_nome.Text    = DP.GetNome();
         }
         else
         {
             lb_nome.Visible = false;
         }
     }
 }
Пример #5
0
 private void bt_pesquisar_Click_1(object sender, EventArgs e)
 {
     foreach (Aluno al in DE.GetListaPessoa().OfType <Aluno>())
     {
         if (al.GetNAluno().ToString() == txt_contribuinte.Text)
         {
             lb_erro.Visible = false;
             lb_nome.Text    = al.GetNome();
         }
         else
         {
             lb_nome.Visible = false;
         }
     }
 }
        public AdicionarProjeto(Departamento D, int escolha)
        {
            InitializeComponent();
            RD = D;
            t  = escolha;

            foreach (Empresa ep in RD.GetListaEmpresa())
            {
                cb_NifEmpresa.Items.Add(ep.getNIF());
            }

            foreach (Pessoa p in RD.GetListaPessoa())
            {
                if (p.QuemSouEu() == "Aluno")
                {
                    cb_Alunos.Items.Add(p.GetNome());
                }
                else
                {
                    if (p.QuemSouEu() == "Docente")
                    {
                        cb_Docente.Items.Add(p.GetNome());
                    }
                }
            }
        }
        private void AdicionarProjeto_Load_1(object sender, EventArgs e)
        {
            if (txt_NomeProj.Text == "" || txt_NomeProj.Text == "")
            {
                erro_nome.SetError(txt_NomeProj, "Introduza um nome.");
            }
            else
            {
                erro_nome.SetError(txt_NomeProj, "");
            }

            if (txt_Objetivo.Text == "")
            {
                erro_objetivo.SetError(txt_Objetivo, "Introduza o Objetivo.");
            }
            else
            {
                erro_objetivo.SetError(txt_Objetivo, "");
            }

            if (txt_Descricao.Text == "")
            {
                erro_descricao.SetError(txt_Descricao, "Introduza uma Descrição.");
            }
            else
            {
                erro_descricao.SetError(txt_Descricao, "");
            }

            lb_notaFinal.Visible  = false;
            txt_notaFinal.Visible = false;
            cb_NomeProj.Visible   = false;
            foreach (Docente D in RD.GetListaPessoa().OfType <Docente>())
            {
                if (D.GetTipoDocente() == "Orientadores")
                {
                    lb_notaFinal.Enabled  = true;
                    txt_notaFinal.Enabled = true;
                }

                else
                {
                    if (D.GetTipoDocente() == "Avaliadores")
                    {
                        lb_Descricao.Enabled  = false;
                        Lb_aluno.Enabled      = false;
                        lb_Descricao.Enabled  = false;
                        lb_NIFEmpresa.Enabled = false;
                        lb_numero.Enabled     = false;
                        Lb_Objetivo.Enabled   = false;
                        lb_Orientador.Enabled = false;
                        //lb_TipoProjeto.Enabled = false;

                        txt_NomeProj.Enabled  = false;
                        txt_Descricao.Enabled = false;
                        txt_numero.Enabled    = false;
                        txt_Objetivo.Enabled  = false;
                    }
                }
            }
        }
Пример #8
0
        private void AdicionarAluno_Load_1(object sender, EventArgs e)
        {
            if (txt_nome.Text == "" || txt_nome.Text == "")
            {
                erro_nome.SetError(txt_nome, "Introduza um nome.");
            }
            else
            {
                erro_nome.SetError(txt_nome, "");
            }

            if (txt_NIF.Text == "000000000")
            {
                erro_contribuinte.SetError(txt_NIF, "Introduza um NIF.");
            }
            else
            {
                erro_contribuinte.SetError(txt_NIF, "");
            }

            if (txt_Email.Text == "")
            {
                erro_email.SetError(txt_Email, "Introduza um E-mail.");
            }
            else
            {
                erro_email.SetError(txt_Email, "");
            }

            if (txt_Telefone.Text == "")
            {
                erro_telefone.SetError(txt_Telefone, "Introduza um Telefone.");
            }
            else
            {
                erro_telefone.SetError(txt_Telefone, "");
            }

            if (txt_Rua.Text == "")
            {
                erro_rua.SetError(txt_Rua, "Introduza uma Rua.");
            }
            else
            {
                erro_rua.SetError(txt_Rua, "");
            }

            if (txt_localidade.Text == "")
            {
                erro_localidade.SetError(txt_localidade, "Introduza uma Localidade.");
            }
            else
            {
                erro_localidade.SetError(txt_localidade, "");
            }

            if (txt_Campo1.Text == "" && txt_Campo2.Text == "")
            {
                erro_codpostal.SetError(txt_Campo2, "Introduza um Codigo Postal.");
            }
            else
            {
                erro_codpostal.SetError(txt_localidade, "");
            }

            if (txt_Numero.Text == "")
            {
                erro_numero.SetError(txt_Numero, "Introduza um Numero.");
            }
            else
            {
                erro_numero.SetError(txt_Numero, "");
            }

            /* if (rb_Feminino=false && rb_Masculino= false)
             *   erro_sexo.SetError("Selecione um Genero");
             * else
             *   erro_sexo.SetError("");
             *
             * /* if (rb_TDM = false && rb_EI = false)
             *   erro_sexo.SetError("Selecione um Genero");
             * else
             *   erro_sexo.SetError(""); */


            switch (t)
            {
            case 0:
                txt_nome.ForeColor   = Color.Gray;
                txt_nome.Font        = new Font(txt_nome.Font.FontFamily, 7);
                txt_nome.Text        = "Introduza o nome do aluno...";
                this.txt_nome.Leave += new System.EventHandler(this.txt_nome_Leave);
                this.txt_nome.Enter += new System.EventHandler(this.txt_nome_Enter);

                txt_NIF.ForeColor   = Color.Gray;
                txt_NIF.Font        = new Font(txt_nome.Font.FontFamily, 7);
                txt_NIF.Text        = "000000000";
                this.txt_NIF.Leave += new System.EventHandler(this.txt_NIF_Leave);
                this.txt_NIF.Enter += new System.EventHandler(this.txt_NIF_Enter);

                txt_Email.ForeColor   = Color.Gray;
                txt_Email.Font        = new Font(txt_Email.Font.FontFamily, 7);
                txt_Email.Text        = "*****@*****.**";
                this.txt_Email.Leave += new System.EventHandler(this.txt_Email_Leave);
                this.txt_Email.Enter += new System.EventHandler(this.txt_Email_Enter);

                txt_Telefone.ForeColor   = Color.Gray;
                txt_Telefone.Font        = new Font(txt_Telefone.Font.FontFamily, 7);
                txt_Telefone.Text        = "900000000";
                this.txt_Telefone.Leave += new System.EventHandler(this.txt_Telefone_Leave);
                this.txt_Telefone.Enter += new System.EventHandler(this.txt_Telefone_Enter);

                txt_Rua.ForeColor   = Color.Gray;
                txt_Rua.Font        = new Font(txt_Rua.Font.FontFamily, 7);
                txt_Rua.Text        = "Introduzir rua...";
                this.txt_Rua.Leave += new System.EventHandler(this.txt_Rua_Leave);
                this.txt_Rua.Enter += new System.EventHandler(this.txt_Rua_Enter);

                txt_localidade.ForeColor   = Color.Gray;
                txt_localidade.Font        = new Font(txt_localidade.Font.FontFamily, 7);
                txt_localidade.Text        = "Introduzir localidade...";
                this.txt_localidade.Leave += new System.EventHandler(this.txt_localidade_Leave);
                this.txt_localidade.Enter += new System.EventHandler(this.txt_localidade_Enter);

                txt_Campo1.ForeColor   = Color.Gray;
                txt_Campo1.Font        = new Font(txt_Campo1.Font.FontFamily, 7);
                txt_Campo1.Text        = "0000";
                this.txt_Campo1.Leave += new System.EventHandler(this.txt_Campo1_Leave);
                this.txt_Campo1.Enter += new System.EventHandler(this.txt_Campo1_Enter);

                txt_Campo2.ForeColor   = Color.Gray;
                txt_Campo2.Font        = new Font(txt_Campo2.Font.FontFamily, 7);
                txt_Campo2.Text        = "000";
                this.txt_Campo2.Leave += new System.EventHandler(this.txt_Campo2_Leave);
                this.txt_Campo2.Enter += new System.EventHandler(this.txt_Campo2_Enter);

                txt_Numero.ForeColor   = Color.Gray;
                txt_Numero.Font        = new Font(txt_Numero.Font.FontFamily, 7);
                txt_Numero.Text        = "00000";
                this.txt_Numero.Leave += new System.EventHandler(this.txt_Numero_Leave);
                this.txt_Numero.Enter += new System.EventHandler(this.txt_Numero_Enter);
                cb_Nome.Visible        = false;//tem uma combobox para quando se editar escolher o aluno por nome

                break;

            case 1:

                txt_nome.Visible          = false;
                rb_Masculino.Visible      = false;
                rb_Feminino.Visible       = false;
                txt_NIF.Enabled           = false;
                gp_DadosEscolares.Enabled = false;
                foreach (Pessoa p in RD.GetListaPessoa())
                {
                    if (p.QuemSouEu() == "Aluno")
                    {
                        cb_Nome.Items.Add(p.GetNome());
                    }
                }

                break;

            default:
                break;
            }
        }
        private void AdicionarDocente_Load(object sender, EventArgs e)
        {
            if (txt_nome.Text == "" || txt_nome.Text == "")
            {
                erro_nomedocente.SetError(txt_nome, "Introduza um nome.");
            }
            else
            {
                erro_nomedocente.SetError(txt_nome, "");
            }

            if (txt_Email.Text == "")
            {
                erro_emaildocente.SetError(txt_Email, "Introduza um E-mail.");
            }
            else
            {
                erro_emaildocente.SetError(txt_Email, "");
            }

            if (txt_Telefone.Text == "")
            {
                erro_telefonedocente.SetError(txt_Telefone, "Introduza um Telefone.");
            }
            else
            {
                erro_telefonedocente.SetError(txt_Telefone, "");
            }

            if (txt_Numero.Text == "")
            {
                erro_numerodocente.SetError(txt_Numero, "Introduza um Numero.");
            }
            else
            {
                erro_numerodocente.SetError(txt_Numero, "");
            }

            if (txt_Disciplina.Text == "")
            {
                erro_disciplinadocente.SetError(txt_Disciplina, "Introduza uma Disciplina.");
            }
            else
            {
                erro_disciplinadocente.SetError(txt_Disciplina, "");
            }

            if (txt_habilitacoes.Text == "")
            {
                erro_habilitacoes.SetError(txt_habilitacoes, "Introduza Habilitaçôes.");
            }
            else
            {
                erro_habilitacoes.SetError(txt_habilitacoes, "");
            }


            switch (i)
            {
            case 0:
                txt_nome.ForeColor   = Color.Gray;
                txt_nome.Font        = new Font(txt_nome.Font.FontFamily, 7);
                txt_nome.Text        = "Introduza o nome do docente...";
                this.txt_nome.Leave += new System.EventHandler(this.txt_nome_Leave);
                this.txt_nome.Enter += new System.EventHandler(this.txt_nome_Enter);

                txt_Email.ForeColor   = Color.Gray;
                txt_Email.Font        = new Font(txt_Email.Font.FontFamily, 7);
                txt_Email.Text        = "*****@*****.**";
                this.txt_Email.Leave += new System.EventHandler(this.txt_Email_Leave);
                this.txt_Email.Enter += new System.EventHandler(this.txt_Email_Enter);

                txt_Telefone.ForeColor   = Color.Gray;
                txt_Telefone.Font        = new Font(txt_Telefone.Font.FontFamily, 7);
                txt_Telefone.Text        = "900000000";
                this.txt_Telefone.Leave += new System.EventHandler(this.txt_Telefone_Leave);
                this.txt_Telefone.Enter += new System.EventHandler(this.txt_Telefone_Enter);

                txt_Numero.ForeColor   = Color.Gray;
                txt_Numero.Font        = new Font(txt_Numero.Font.FontFamily, 7);
                txt_Numero.Text        = "00000";
                this.txt_Numero.Leave += new System.EventHandler(this.txt_Numero_Leave);
                this.txt_Numero.Enter += new System.EventHandler(this.txt_Numero_Enter);

                txt_Disciplina.ForeColor   = Color.Gray;
                txt_Disciplina.Font        = new Font(txt_Disciplina.Font.FontFamily, 7);
                txt_Disciplina.Text        = "Introduza disciplina...";
                this.txt_Disciplina.Leave += new System.EventHandler(this.txt_Disciplina_Leave);
                this.txt_Disciplina.Enter += new System.EventHandler(this.txt_Disciplina_Enter);

                txt_Disciplina.ForeColor   = Color.Gray;
                txt_Disciplina.Font        = new Font(txt_Disciplina.Font.FontFamily, 7);
                txt_Disciplina.Text        = "Introduza disciplina...";
                this.txt_Disciplina.Leave += new System.EventHandler(this.txt_Disciplina_Leave);
                this.txt_Disciplina.Enter += new System.EventHandler(this.txt_Disciplina_Enter);

                txt_habilitacoes.ForeColor   = Color.Gray;
                txt_habilitacoes.Font        = new Font(txt_Disciplina.Font.FontFamily, 7);
                txt_habilitacoes.Text        = "Introduza habilitações...";
                this.txt_habilitacoes.Leave += new System.EventHandler(this.txt_habilitacoes_Leave);
                this.txt_habilitacoes.Enter += new System.EventHandler(this.txt_habilitacoes_Enter);
                cb_Nome.Visible              = false;
                break;

            case 1:
                foreach (Docente ad in RD.GetListaPessoa().OfType <Docente>())
                {
                    cb_Nome.Items.Add(ad.GetNome());
                }

                txt_nome.Visible     = false;
                rb_Masculino.Enabled = false;
                rb_Feminino.Enabled  = false;
                txt_Numero.Visible   = false;

                break;

            default:
                break;
            }
        }