protected void Page_Load(object sender, EventArgs e) { DAL.DALAluno dalalu = new DAL.DALAluno(); if (!dalalu.verifADM(Session["Nome"], Session["Senha"])) { Response.Redirect("~/WebFormIndex.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { DAL.DALAluno dalalu = new DAL.DALAluno(); if (!dalalu.verifADM(Session["Nome"], Session["Senha"])) { Response.Redirect("~/WebFormIndex.aspx"); } Session["idExercicio"] = Request.QueryString["idExercicio"]; }
protected void Page_Load(object sender, EventArgs e) { //Definindo variáveis que serão utilizadas na table TableRow tr1, tr2, tr3; TableCell tc0; Label titulo = new Label(); Label questao = new Label(); Image fotoquestao = new Image(); Label c = new Label(); DAL.DALDesafio daldes = new DAL.DALDesafio(); Modelo.Desafio des = new Modelo.Desafio(); des = daldes.Select(Convert.ToInt32(Session["idDesafio"]))[0]; string codigo = Session["idDesafio"].ToString(); //Adicionando título da questão do Desafio na table titulo.Text = des.titulo; titulo.Font.Name = "Segoe UI Light"; titulo.Font.Size = 16; titulo.Font.Bold = true; tc0 = new TableCell(); tc0.Controls.Add(titulo); tr1 = new TableRow(); tr1.Cells.Add(tc0); Table1.Rows.Add(tr1); //Adicionando imagem da questão do Desafio na table if (des.fotoquestao != null) { fotoquestao.ImageUrl = "~/HandlerDesafio2.ashx?idDesafio=" + codigo; } tc0 = new TableCell(); tc0.Controls.Add(fotoquestao); tr2 = new TableRow(); tr2.Cells.Add(tc0); Table1.Rows.Add(tr2); //Adicionando texto da questão do Desafio na table questao.Text = des.questao; questao.Font.Name = "Segoe UI Light"; questao.Font.Size = 14; questao.Font.Bold = true; tc0 = new TableCell(); tc0.Controls.Add(questao); tr3 = new TableRow(); tr3.Cells.Add(tc0); Table1.Rows.Add(tr3); DAL.DALAluno dalalu = new DAL.DALAluno(); if (!dalalu.verifADM(Session["Nome"], Session["Senha"])) { Response.Redirect("~/WebFormIndex.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { Modelo.Exercicio exer = new Modelo.Exercicio(); DAL.DALExercicio dalexercicio = new DAL.DALExercicio(); exer = dalexercicio.Select(Convert.ToInt32(Session["idExercicio"]))[0]; //Definindo variáveis que serão utilizadas na table TableRow tr1, tr2, tr3; TableCell tc0; Label titulo = new Label(); Label questao = new Label(); Image fotoquestao = new Image(); //Adicionando título da questão do Desafio na table titulo.Text = exer.titulo; titulo.Font.Name = "Segoe UI Light"; titulo.Font.Size = 16; titulo.Font.Bold = true; tc0 = new TableCell(); tc0.Controls.Add(titulo); tr1 = new TableRow(); tr1.Cells.Add(tc0); Table1.Rows.Add(tr1); //Adicionando imagem da questão do Desafio na table if (exer.fotoquestao != null) { fotoquestao.ImageUrl = "~/HandlerExercicio2.ashx?idExercicio=" + exer.idExercicio; } tc0 = new TableCell(); tc0.Controls.Add(fotoquestao); tr2 = new TableRow(); tr2.Cells.Add(tc0); Table1.Rows.Add(tr2); //Adicionando texto da questão do Desafio na table questao.Text = exer.questao; questao.Font.Name = "Segoe UI Light"; questao.Font.Size = 14; questao.Font.Bold = true; tc0 = new TableCell(); tc0.Controls.Add(questao); tr3 = new TableRow(); tr3.Cells.Add(tc0); Table1.Rows.Add(tr3); DAL.DALAluno dalalu = new DAL.DALAluno(); if (!dalalu.verifADM(Session["Nome"], Session["Senha"])) { Response.Redirect("~/WebFormIndex.aspx"); } HyperLink1.NavigateUrl = "~/WebFormExercicioNew.aspx?idMateria=" + Session["idMateria"]; }
protected void Page_Load(object sender, EventArgs e) { if ((Session["Nome"] != null) && (Session["Senha"] != null)) { DAL.DALAluno dalalu = new DAL.DALAluno(); if (!dalalu.verifADM(Session["Nome"], Session["Senha"])) { Button5.Text = "Sair"; ImageButton1.ImageUrl = "HandlerAluno.ashx"; } else { Button5.Text = "Sair"; ImageButton1.ImageUrl = "HandlerAluno.ashx"; } } else { Button5.Text = "Entrar"; ImageButton1.AlternateText = " "; } }
protected void Page_Load(object sender, EventArgs e) { if ((Session["Nome"] != null) && (Session["Senha"] != null)) { DAL.DALAluno dalalu = new DAL.DALAluno(); if (!dalalu.verifADM(Session["Nome"], Session["Senha"])) { Label user = new Label(); user.Text = "Bem-vindo, " + Session["nome"]; div1.Controls.Add(user); } else { HyperLink adm = new HyperLink(); adm.Text = "Página do Administrador"; adm.NavigateUrl = "~/WebFormAdministrador.aspx"; Label nomeadm = new Label(); nomeadm.Text = "Bem-vindo, " + Session["nome"] + "<br />"; div1.Controls.Add(nomeadm); div1.Controls.Add(adm); } } else { Response.Redirect("~/WebFormAutenticar.aspx"); } double Qfacil = 0; double QMedio = 0; double QDificil = 0; double QTotal = 0; List <Modelo.Exercicio> exercicios = new List <Modelo.Exercicio>(); DAL.DALExercicio dalexe = new DAL.DALExercicio(); exercicios = dalexe.SelectAllIDdif(1); List <Modelo.RespostaDoAlunoExercicio> resp = new List <Modelo.RespostaDoAlunoExercicio>(); DAL.DALRespostaDoAlunoExercicio dalresp = new DAL.DALRespostaDoAlunoExercicio(); resp = dalresp.SelectAllIdDif(1, Session["Nome"].ToString()); int aux1 = 0; int aux2 = 0; aux1 += resp.Count; aux2 += exercicios.Count; Qfacil = Math.Round(((1.0 * resp.Count / exercicios.Count) * 100), 2); exercicios = dalexe.SelectAllIDdif(2); resp = dalresp.SelectAllIdDif(2, Session["Nome"].ToString()); aux1 += resp.Count; aux2 += exercicios.Count; QMedio = Math.Round(((1.0 * resp.Count / exercicios.Count) * 100), 2); exercicios = dalexe.SelectAllIDdif(3); resp = dalresp.SelectAllIdDif(3, Session["Nome"].ToString()); aux1 += resp.Count; aux2 += exercicios.Count; QDificil = Math.Round(((1.0 * resp.Count / exercicios.Count) * 100), 2); QTotal = Math.Round(((1.0 * aux1 / aux2) * 100), 2); Label1.Text = Qfacil.ToString() + "%"; Label2.Text = QMedio.ToString() + "%"; Label3.Text = QDificil.ToString() + "%"; Label4.Text = QTotal.ToString() + "%"; }