Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        alunoID = Session["LoginUser"].ToString();
        LoginTextOut.InnerHtml = "<p>" + alunoID + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);


        if (!IsPostBack)
        {
            //Inserir itens na cbb
            ddl_tipo.Items.Clear();
            ddl_tipo.Items.Add("Aluno");
            ddl_tipo.Items.Add("Tutor");
            ddl_tipo.Items.Add("Admin");

            //Meter o nome da pessoa no Titulo e atualizar txt
            for (int i = 0; i < alunos.Count(); i++)
            {
                if (alunos[i].AlunoID == alunoID)
                {
                    outTitulo.InnerHtml    = alunos[i].Nome;
                    txt_DataNasc.Text      = alunos[i].DataNasc.ToShortDateString();
                    txt_morada.Text        = alunos[i].Morada;
                    txt_nome.Text          = alunos[i].Nome;
                    txt_telefone.Text      = alunos[i].Telefone;
                    txt_turma.Text         = alunos[i].Turma;
                    ddl_tipo.SelectedIndex = 2;
                }
            }
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        ws = new TutoriasService(disciplinas, alunos, apoios);

        string temp = Request.Form["chk_aprovAp"];

        if (temp != "" && temp != null)
        {
            string[] Aprov = temp.Split(',');

            for (int i = 0; i < Aprov.Count(); i++)
            {
                for (int i2 = 0; i2 < apoios.Count(); i2++)
                {
                    if (Convert.ToInt32(Aprov[i].Trim()) == apoios[i2].ApoioID)
                    {
                        ws.DelAp(apoios, apoios[i2]);
                        break;
                    }
                }
            }
        }
        Response.Redirect("AnularPedido.aspx");
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);

        //Inserir itens na tabela
        OutUsers.InnerHtml = "";
        for (int i = 0; i < alunos.Count(); i++)
        {
            OutUsers.InnerHtml += "<tr>";
            OutUsers.InnerHtml += "<td>" + alunos[i].AlunoID + "</td>";
            OutUsers.InnerHtml += "<td>" + alunos[i].Nome + "</td>";
            OutUsers.InnerHtml += "<td>" + alunos[i].Turma + "</td>";
            OutUsers.InnerHtml += "<td>" + alunos[i].DataNasc.ToShortDateString() + "</td>";

            if (alunos[i].Telefone == null || alunos[i].Telefone == "")
            {
                OutUsers.InnerHtml += "<td> - </td>";
            }
            else
            {
                OutUsers.InnerHtml += "<td>" + alunos[i].Telefone + "</td>";
            }

            if (alunos[i].Morada == null || alunos[i].Morada == "")
            {
                OutUsers.InnerHtml += "<td> - </td>";
            }
            else
            {
                OutUsers.InnerHtml += "<td>" + alunos[i].Morada + "</td>";
            }

            switch (alunos[i].Tipo)
            {
            case Alunos.enumTipo.Aluno:
                OutUsers.InnerHtml += "<td>Aluno</td>";
                break;

            case Alunos.enumTipo.Tutor:
                OutUsers.InnerHtml += "<td>Tutor</td>";
                break;

            case Alunos.enumTipo.Admin:
                OutUsers.InnerHtml += "<td>Admin</td>";
                break;
            }
            OutUsers.InnerHtml += "</tr>";
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        ws = new TutoriasService(disciplinas, alunos, apoios);
        int i2 = 0;

        //Encontrar objeto do utilizador que fez login
        for (i2 = 0; i2 < alunos.Count(); i2++)
        {
            if (alunos[i2].AlunoID == Session["LoginUser"].ToString())
            {
                break;
            }
        }

        //Atualizar Nome de login
        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";

        //Atualizar mensagem de boas vindas
        WelcomeTextLogin.InnerHtml += alunos[i2].Nome + ".";

        //Atualizar total de utilizadores
        TotalUtilizadores.InnerHtml = alunos.Count().ToString();

        //Atualizar quantidade de utilizadores por aprovar
        int qtdAl = 0;

        for (int i = 0; i < alunos.Count(); i++)
        {
            if (alunos[i].Aprovado == false)
            {
                qtdAl++;
            }
        }
        UtilizadoresPorAprovar.InnerHtml = qtdAl.ToString();

        //Atualizar Total de apoios
        TotalApoios.InnerHtml = apoios.Count().ToString();

        //Atualizar quantidade de apoios por aprovar
        int qtdAp = 0;

        for (int i = 0; i < apoios.Count(); i++)
        {
            if (apoios[i].Estado == Apoios.enumEstado.Pendente)
            {
                qtdAp++;
            }
        }
        ApoiosPorAprovar.InnerHtml = qtdAp.ToString();
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }

        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);
        if (!IsPostBack)
        {
            ddl_tipo.Items.Add("Aluno");
            ddl_tipo.Items.Add("Tutor");
            ddl_tipo.Items.Add("Admin");
        }
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);

        //Inserir itens na tabela
        for (int i = 0; i < apoios.Count(); i++)
        {
            OutUsers.InnerHtml += "<tr>";
            OutUsers.InnerHtml += "<th scope=\"row\">" + apoios[i].ApoioID.ToString() + "</th>";
            OutUsers.InnerHtml += "<td>" + apoios[i].AlunoID + "</td>";
            OutUsers.InnerHtml += "<td>" + apoios[i].TutorID + "</td>";
            OutUsers.InnerHtml += "<td>" + apoios[i].Sigla + "</td>";
            OutUsers.InnerHtml += "<td>" + apoios[i].ReqDate.ToShortDateString() + "</td>";
            OutUsers.InnerHtml += "<td>" + apoios[i].Local + "</td>";

            if (apoios[i].Descricao == null || apoios[i].Descricao == "")
            {
                OutUsers.InnerHtml += "<td> - </td>";
            }
            else
            {
                OutUsers.InnerHtml += "<td>" + apoios[i].Descricao + "</td>";
            }

            switch (apoios[i].Estado)
            {
            case Apoios.enumEstado.Pendente:
                OutUsers.InnerHtml += "<td><input name=\"chk_aprovAp\" type=\"checkbox\" value=\"" + apoios[i].ApoioID + "\"/></td>";
                break;

            case Apoios.enumEstado.Aceite:
                OutUsers.InnerHtml += "<td><input name=\"chk_aprovAp\" type=\"checkbox\" value=\"" + apoios[i].ApoioID + "\" checked /></td>";
                break;

            //Nao e necessario estar aqui mas facilita se algum dia for preciso incluir
            case Apoios.enumEstado.Concluido:
                OutUsers.InnerHtml += "<td>Concluido</td>";
                break;
            }
            OutUsers.InnerHtml += "</tr>";
        }
    }
Example #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);

        if (!IsPostBack)
        {
            //Inserir itens nas cbb
            ddl_disc.Items.Clear();
            for (int i = 0; i < disciplinas.Count(); i++)
            {
                ddl_disc.Items.Add(disciplinas[i].Sigla);
            }

            if (Session["LoginTipo"].ToString() == "Aluno")
            {
                OutNomeDDL.InnerHtml = "<label class=\" form - control - label\">Tutor<a style=\"color: red\">*</a></label>";
                ddl_user.Items.Clear();
                for (int i = 0; i < alunos.Count(); i++)
                {
                    if (alunos[i].Tipo == Alunos.enumTipo.Tutor && alunos[i].Aprovado == true)
                    {
                        ddl_user.Items.Add(alunos[i].AlunoID);
                    }
                }
            }
            else
            {
                OutNomeDDL.InnerHtml = "<label class=\" form - control - label\">Aluno<a style=\"color: red\">*</a></label>";
                ddl_user.Items.Clear();
                for (int i = 0; i < alunos.Count(); i++)
                {
                    if (alunos[i].Tipo == Alunos.enumTipo.Aluno && alunos[i].Aprovado == true)
                    {
                        ddl_user.Items.Add(alunos[i].AlunoID);
                    }
                }
            }
        }
    }
Example #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);

        if (!IsPostBack)
        {
            //Inserir itens na cbb
            ddl_sigla.Items.Clear();
            for (int i = 0; i < disciplinas.Count(); i++)
            {
                ddl_sigla.Items.Add(disciplinas[i].Sigla);
            }
        }
    }
Example #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        ws = new TutoriasService(disciplinas, alunos, apoios);
        int i = 0;

        //Encontrar objeto do utilizador que fez login
        for (i = 0; i < alunos.Count(); i++)
        {
            if (alunos[i].AlunoID == Session["LoginUser"].ToString())
            {
                break;
            }
        }

        LoginTextOut.InnerHtml      = "<p>" + Session["LoginUser"].ToString() + "</p>";
        WelcomeTextLogin.InnerHtml += alunos[i].Nome + ".";
    }
Example #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        ws = new TutoriasService(disciplinas, alunos, apoios);



        //Inserir texto das txt num array string
        string[] text = new string[apoios.Count()];
        int      qtd  = 0;

        int[] ids = new int[apoios.Count()];

        for (int i = 0; i < apoios.Count(); i++)
        {
            if (apoios[i].Estado == Apoios.enumEstado.Concluido && (apoios[i].Avaliacao == "" || apoios[i].Avaliacao == null))
            {
                if (Request.Form[apoios[i].ApoioID.ToString()] != "" && Request.Form[apoios[i].ApoioID.ToString()] != null)
                {
                    text[qtd] = Request.Form[apoios[i].ApoioID.ToString()];
                    ids[qtd]  = apoios[i].ApoioID;
                    qtd++;
                }
            }
        }


        if (qtd != 0)
        {
            for (int i = 0; i < qtd; i++)
            {
                ws.EditAp(apoios, ids[i], null, null, null, null, null, null, text[i], null);
            }
        }
        Response.Redirect("HistoricoApoios.aspx");
    }
Example #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        ws = new TutoriasService(disciplinas, alunos, apoios);

        string temp = Request.Form["chk_aprovAp"];

        //Desaprovar toda a gente para aprovar apenas aqueles que estao marcados
        for (int i = 0; i < apoios.Count(); i++)
        {
            if (apoios[i].Estado != Apoios.enumEstado.Concluido)
            {
                ws.EditAp(apoios, apoios[i].ApoioID, null, null, null, null, "Pendente", null, null, null);
            }
        }


        if (temp != "" && temp != null)
        {
            string[] Aprov = temp.Split(',');

            for (int i = 0; i < Aprov.Count(); i++)
            {
                for (int i2 = 0; i2 < apoios.Count(); i2++)
                {
                    if (Convert.ToInt32(Aprov[i]) == apoios[i2].ApoioID)
                    {
                        ws.EditAp(apoios, apoios[i2].ApoioID, null, null, null, null, "Aceite", null, null, null);
                        break;
                    }
                }
            }
        }
        Response.Redirect("AprovApoio.aspx");
    }
Example #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        ws = new TutoriasService(disciplinas, alunos, apoios);

        string temp = Request.Form["chk_aprovado"];

        //Desaprovar toda a gente para aprovar apenas aqueles que estao marcados
        for (int i = 0; i < alunos.Count(); i++)
        {
            if (alunos[i].Tipo != Alunos.enumTipo.Admin)
            {
                ws.EditAl(alunos, alunos[i].AlunoID, false);
            }
        }


        if (temp != "" && temp != null)
        {
            string[] Aprov = temp.Split(',');

            for (int i = 0; i < Aprov.Count(); i++)
            {
                for (int i2 = 0; i < alunos.Count(); i2++)
                {
                    if (Aprov[i] == alunos[i2].AlunoID)
                    {
                        ws.EditAl(alunos, alunos[i2].AlunoID, true);
                        break;
                    }
                }
            }
        }
        Response.Redirect("AprovUtilizadores.aspx");
    }
Example #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);

        int rowCnt = 0;

        //Inserir itens na tabela
        for (int i = 0; i < alunos.Count(); i++)
        {
            if (alunos[i].Tipo != Alunos.enumTipo.Admin)
            {
                OutUsers.InnerHtml += "<tr>";
                OutUsers.InnerHtml += "<th scope=\"row\">" + (rowCnt + 1) + "</th>";
                OutUsers.InnerHtml += "<td>" + alunos[i].AlunoID + "</td>";
                OutUsers.InnerHtml += "<td>" + alunos[i].Nome + "</td>";
                OutUsers.InnerHtml += "<td>" + alunos[i].Turma + "</td>";
                OutUsers.InnerHtml += "<td>" + alunos[i].DataNasc.ToShortDateString() + "</td>";

                if (alunos[i].Telefone == null || alunos[i].Telefone == "")
                {
                    OutUsers.InnerHtml += "<td> - </td>";
                }
                else
                {
                    OutUsers.InnerHtml += "<td>" + alunos[i].Telefone + "</td>";
                }

                if (alunos[i].Morada == null || alunos[i].Morada == "")
                {
                    OutUsers.InnerHtml += "<td> - </td>";
                }
                else
                {
                    OutUsers.InnerHtml += "<td>" + alunos[i].Morada + "</td>";
                }

                switch (alunos[i].Tipo)
                {
                case Alunos.enumTipo.Aluno:
                    OutUsers.InnerHtml += "<td>Aluno</td>";
                    break;

                case Alunos.enumTipo.Tutor:
                    OutUsers.InnerHtml += "<td>Tutor</td>";
                    break;

                //Nao e necessario estar aqui mas facilita se algum dia for preciso incluir
                case Alunos.enumTipo.Admin:
                    OutUsers.InnerHtml += "<td>Admin</td>";
                    break;
                }

                if (alunos[i].Aprovado == true)
                {
                    OutUsers.InnerHtml += "<td><input name=\"chk_aprovado\" type=\"checkbox\" value=\"" + alunos[i].AlunoID + "\" checked /></td>";
                }
                else
                {
                    OutUsers.InnerHtml += "<td><input name=\"chk_aprovado\" type=\"checkbox\" value=\"" + alunos[i].AlunoID + "\" /></td>";
                }

                OutUsers.InnerHtml += "</tr>";

                rowCnt++;
            }
        }
    }
Example #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginUser"] == null || Session["LoginTipo"] == null)
        {
            Response.Redirect("~/StartPage/Login.aspx");
        }
        LoginTextOut.InnerHtml = "<p>" + Session["LoginUser"].ToString() + "</p>";
        ws = new TutoriasService(disciplinas, alunos, apoios);

        //Inserir itens na tabela
        if (!IsPostBack)
        {
            if (Session["LoginTipo"].ToString() == "Aluno")
            {
                OutUsers.InnerHtml = "";
                for (int i = 0; i < apoios.Count(); i++)
                {
                    if (apoios[i].Estado == Apoios.enumEstado.Concluido && apoios[i].AlunoID == Session["LoginUser"].ToString())
                    {
                        OutUsers.InnerHtml += "<tr>";
                        OutUsers.InnerHtml += "<th scope=\"row\">" + apoios[i].ApoioID.ToString() + "</th>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].AlunoID + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].TutorID + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].Sigla + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].ReqDate.ToShortDateString() + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].Local + "</td>";

                        if (apoios[i].Descricao == null || apoios[i].Descricao == "")
                        {
                            OutUsers.InnerHtml += "<td> - </td>";
                        }
                        else
                        {
                            OutUsers.InnerHtml += "<td>" + apoios[i].Descricao + "</td>";
                        }

                        if (apoios[i].Avaliacao != "" && apoios[i].Avaliacao != null)
                        {
                            OutUsers.InnerHtml += "<td>" + apoios[i].Avaliacao + "</td>";
                        }
                        else
                        {
                            OutUsers.InnerHtml += "<td><input name=" + apoios[i].ApoioID.ToString() + " id=" + i.ToString() + " type=\"text\"/></td>";
                        }

                        OutUsers.InnerHtml += "</tr>";
                    }
                }
            }
            else
            {
                OutUsers.InnerHtml = "";
                for (int i = 0; i < apoios.Count(); i++)
                {
                    if (apoios[i].Estado == Apoios.enumEstado.Concluido && apoios[i].TutorID == Session["LoginUser"].ToString())
                    {
                        OutUsers.InnerHtml += "<tr>";
                        OutUsers.InnerHtml += "<th scope=\"row\">" + apoios[i].ApoioID.ToString() + "</th>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].AlunoID + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].TutorID + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].Sigla + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].ReqDate.ToShortDateString() + "</td>";
                        OutUsers.InnerHtml += "<td>" + apoios[i].Local + "</td>";

                        if (apoios[i].Descricao == null || apoios[i].Descricao == "")
                        {
                            OutUsers.InnerHtml += "<td> - </td>";
                        }
                        else
                        {
                            OutUsers.InnerHtml += "<td>" + apoios[i].Descricao + "</td>";
                        }

                        if (apoios[i].Avaliacao != "" && apoios[i].Avaliacao != null)
                        {
                            OutUsers.InnerHtml += "<td>" + apoios[i].Avaliacao + "</td>";
                        }
                        else
                        {
                            OutUsers.InnerHtml += "<td><input name=" + apoios[i].ApoioID.ToString() + " id=" + i.ToString() + " type=\"text\"/></td>";
                        }

                        OutUsers.InnerHtml += "</tr>";
                    }
                }
            }
        }
    }