コード例 #1
0
        public ActionResult FangQi()
        {
            ChoseThemeDal     cd                = new ChoseThemeDal();
            Student           s                 = (Student)Session["student"];
            int               theme_id          = Convert.ToInt32(Request["themeid"]);
            ChoseThemeService chosethemeservice = new ChoseThemeService();

            //  ChoseTheme ct = chosethemeservice.GetChoseThemeByStuId((int)s.Stu_Id);
            //   ChoseTheme chot=chosethemeservice.NoSelectTheme(ct);


            // ChoseTheme c=cd.UpdateEntity(ct);
            //string str = js.Serialize(chot);
            //Response.Write(str);
            //Response.End();
            return(View());
        }
コード例 #2
0
        public ActionResult GetMyThemes()
        {
            ChoseThemeDal d = new ChoseThemeDal();
            Student       s = (Student)Session["student"];

            if (s == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            ChoseThemeService       chosethemeservice = new ChoseThemeService();
            IQueryable <ChoseTheme> c = d.GetEntities(u => u.CT_Id > 0);
            //  IList<Profession> pro= p.GetAllProfession();
            IQueryable <ChoseTheme> themes = d.GetEntities(u => u.Student.Stu_Num == s.Stu_Num);
            string str = js.Serialize(themes);

            Response.Write(str);
            Response.End();
            return(View());
        }
コード例 #3
0
        public ActionResult GetStuGradeByPro(int pageIndex = 1, int pageSize = 3)
        {
            BaseDal <Grade> based    = new BaseDal <Grade>();
            GradeService    gradeser = new GradeService();
            ChoseThemeDal   c        = new ChoseThemeDal();
            GradeDal        g        = new GradeDal();
            StudentDal      studal   = new StudentDal();
            int             total;

            if (Request["action"] == "gettotal")
            {
                string               pro   = Request["pro"];
                IQueryable <Grade>   iq    = gradeser.GetAllGradeByPro(pro, true);
                IQueryable <Student> stuiq = studal.GetEntities(u => u.Profession.Pro_Name == pro);
                total = iq.Count();
                int    prototal = stuiq.Count();
                int[]  arr      = { pageIndex, pageSize, total, prototal };
                string str      = js.Serialize(arr);
                Response.Write(str);
            }
            if (Request["action"] == "getgrade")
            {
                string             pro = Request["pro"];
                IQueryable <Grade> iq  = gradeser.GetAllGradeByPro(pro, true);
                total = iq.Count();
                int pgindex = Convert.ToInt32(Request["pgindex"]);
                iq = based.GetPageEntities <int?>(pageSize, pgindex, out total, u => u.Student.Profession.Pro_Name == pro, u => u.Score, true);
                IList <string> strl = new List <string>();
                foreach (var item in iq)
                {
                    string s = item.Student.Stu_Name + "-" + item.Theme.Theme_Name + "-" + item.Teacher.Tea_Name + "-" + item.Score;
                    strl.Add(s);
                }
                string str = js.Serialize(strl);
                Response.Write(str);
            }
            Response.End();

            return(View());
        }