Esempio n. 1
0
 public ActionResult TestLibrary(CLoadTest cl)
 {
     ViewBag.Grade   = string.IsNullOrEmpty(cl.Grade) ? "全部" : cl.Grade;
     ViewBag.Subject = string.IsNullOrEmpty(cl.Subject) ? "全部" : cl.Subject;
     ViewBag.Topic   = string.IsNullOrEmpty(cl.Topic) ? "全部" : cl.Topic;
     return(View());
 }
Esempio n. 2
0
 public ActionResult SetVolumeOnline(CLoadTest cl)
 {
     ViewBag.Period         = string.IsNullOrEmpty(cl.Period) ? "小学试题" : cl.Period;
     ViewBag.Grade          = string.IsNullOrEmpty(cl.Grade)?"一年级":cl.Grade;
     ViewBag.Grade_Son      = string.IsNullOrEmpty(cl.Grade_Son)?"全部":cl.Grade_Son;
     ViewBag.Grade_Grandson = string.IsNullOrEmpty(cl.Grade_Grandson)?"全部":cl.Grade_Grandson;
     ViewBag.Subject        = string.IsNullOrEmpty(cl.Subject)?"语文":cl.Subject;
     ViewBag.Topic          = string.IsNullOrEmpty(cl.Topic)?"全部":cl.Topic;
     return(View());
 }
Esempio n. 3
0
        public ActionResult LoadTest_SetVolume(CLoadTest cl)
        {
            EODB eodb = new EODB();
            List <QuestionInfo> questioninfo = new List <QuestionInfo>();

            questioninfo = (from i in eodb.questioninfo
                            where (i.Question_Grade == ((cl.Grade == "全部") ? i.Question_Grade : cl.Grade)) && (i.Question_Grade_Son == ((cl.Grade_Son == "全部")?i.Question_Grade_Son:cl.Grade_Son)) && (i.Question_Grade_Grandson == ((cl.Grade_Grandson == "全部")?i.Question_Grade_Grandson:cl.Grade_Grandson)) && (i.Question_Subject == ((cl.Subject == "全部") ? i.Question_Subject : cl.Subject)) && (i.Question_Topic == ((cl.Topic == "全部") ? i.Question_Topic : cl.Topic))
                            select i).ToList <QuestionInfo>();
            return(Json(questioninfo));
        }
Esempio n. 4
0
        public ActionResult LoadTest(CLoadTest cl)
        {
            int level = 0;

            if (!string.IsNullOrEmpty(cl.Grade_Son))
            {
                level++;
            }
            if (!string.IsNullOrEmpty(cl.Grade_Grandson))
            {
                level++;
            }
            EODB eodb             = new EODB();
            List <QuestionInfo> t = new List <QuestionInfo>();;

            if (cl.Topic != "全部")
            {
                switch (level)
                {
                case 0:
                    t = (from i in eodb.questioninfo
                         where (i.Question_Subject == cl.Subject) && (i.Question_Topic == cl.Topic) && (i.Question_Grade == cl.Grade) && (i.Question_State == true)
                         select i).ToList <QuestionInfo>();
                    break;

                case 1:
                    t = (from i in eodb.questioninfo
                         where (i.Question_Subject == cl.Subject) && (i.Question_Topic == cl.Topic) && (i.Question_Grade == cl.Grade) && (i.Question_Grade_Son == cl.Grade_Son) && (i.Question_State == true)
                         select i).ToList <QuestionInfo>();
                    break;

                case 2:
                    t = (from i in eodb.questioninfo
                         where (i.Question_Subject == cl.Subject) && (i.Question_Topic == cl.Topic) && (i.Question_Grade == cl.Grade) && (i.Question_Grade_Son == cl.Grade_Son) && (i.Question_Grade_Grandson == cl.Grade_Grandson) && (i.Question_State == true)
                         select i).ToList <QuestionInfo>();
                    break;
                }
            }
            else
            {
                switch (level)
                {
                case 0:
                    t = (from i in eodb.questioninfo
                         where (i.Question_Subject == cl.Subject) && (i.Question_Grade == cl.Grade) && (i.Question_State == true)
                         select i).ToList <QuestionInfo>();
                    break;

                case 1:
                    t = (from i in eodb.questioninfo
                         where (i.Question_Subject == cl.Subject) && (i.Question_Grade == cl.Grade) && (i.Question_Grade_Son == cl.Grade_Son) && (i.Question_State == true)
                         select i).ToList <QuestionInfo>();
                    break;

                case 2:
                    t = (from i in eodb.questioninfo
                         where (i.Question_Subject == cl.Subject) && (i.Question_Grade == cl.Grade) && (i.Question_Grade_Son == cl.Grade_Son) && (i.Question_Grade_Grandson == cl.Grade_Grandson) && (i.Question_State == true)
                         select i).ToList <QuestionInfo>();
                    break;
                }
            }
            return(Json(t));
        }