Esempio n. 1
0
        public ActionResult ChartPartial()
        {
            iys.ModelProject.iysContext db = new ModelProject.iysContext();
            var model = db.USER_ANSWERS;
            List <succesVievModel> scList = new List <succesVievModel>();
            succesVievModel        scK    = new succesVievModel();

            scK.name = "Kalan";
            scK.puan = db.DOCUMENTS.Count();
            succesVievModel scS = new succesVievModel();

            scS.name = "Biten";
            scS.puan = db.USER_QUIZ_STATUSS.Where(x => x.USER_CODE == User.Identity.Name).Where(x => x.GRADE >= 50).Count();
            scK.puan = scK.puan - scS.puan;
            scList.Add(scK);
            scList.Add(scS);
            return(PartialView("_ChartPartial", scList));
        }
Esempio n. 2
0
        public ActionResult userInfoPartial()
        {
            iys.ModelProject.iysContext db = new ModelProject.iysContext();
            int model = 0;

            try
            {
                model = (int)db.USER_QUIZ_STATUSS.Where(x => x.USER_CODE == User.Identity.Name).Average(x => x.GRADE).Value;
            }
            catch (Exception)
            {
            }

            ////(from d in db.USER_QUIZ_STATUSS
            //         where d.USER_CODE==User.Identity.Name
            //         select new succesVievModel { name = d.USER_CODE, puan = d.GRADE });
            succesVievModel sv = new succesVievModel();

            sv.name = User.Identity.Name;
            sv.puan = model;
            return(PartialView("_userInfoPartial", sv));
        }