Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var bll = new BLL.UserComponents();
            var user = new Entities.User();
            if (Session["UserLogin"] != null)
                user = bll.GetUser(Session["UserLogin"].ToString());
            var test = new BLL.TestComponents().FindTest(Guid.Parse(Request["test"]));
            var blls = new BLL.StatisticComponents();
            var guid = Guid.Parse(Request["stat"]);
            var stat = new BLL.StatisticComponents().GetTestStatistics().Where(s => s.ID.CompareTo(guid) == 0).First();

            foreach (var q in test.Questions)
            {
                var temp = stat.CorrectQuestions.Where(s => s.Correct == q.Text);
                if (temp.Count() > 0)
                    stats.Add(new Tuple<string, string>(q.Text, "Верно"));
                else stats.Add(new Tuple<string, string>(q.Text, "Неверно"));
            }

            RepeaterStats.DataSource = stats;
            DataBind();

            if (Session["IsTrue"] != null)
            {
                blls.DeleteStatistic(stat);
                Session["IsTrue"] = null;
            }
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     var bll = new BLL.UserComponents();
     var user = bll.GetUser(Session["UserLogin"].ToString());
     if (user != null)
     {
         var bllt = new BLL.TestComponents();
         RepeaterTests.DataSource = bllt.GetTests(user.Login);
         DataBind();
     }
 }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var bll = new BLL.UserComponents();
            var user = bll.GetUser(Session["UserLogin"].ToString());
            var blls = new BLL.StatisticComponents();
            var bllt = new BLL.TestComponents();
            var stats =  blls.GetTestStatistic(user);

            foreach (var stat in stats)
            {
                var test = bllt.FindTest(stat.TestName).First();
                TestNames.Add(new Tuple<string, int, int>(stat.TestName, stat.CorrectQuestions.Count, test.Questions.Count));
            }

            RepeaterStats.DataSource = TestNames;
            if (TestNames.Count == 0)
                NullText.Visible = true;
            else NullText.Visible = false;
            DataBind();
        }