Ejemplo n.º 1
0
        public ActionResult GetAllMyFuZeLunWen()
        {
            Teacher  s  = (Teacher)Session["teacher"];
            TeaGroup tg = s.TeaGroup;

            if (tg == null)
            {
                Response.Write("");
                Response.End();
                return(View());
            }
            ChoseThemeService       chosetser = new ChoseThemeService();
            IQueryable <ChoseTheme> choiq     = chosetser.GetAllChoseTheme();
            StuFileService          sfser     = new StuFileService();
            IList <int>             stuidlist = new List <int>();
            IList <string>          strlist   = new List <string>();
            string str = "";
            int    m   = 0;

            strlist.Add(tg.TG_Name);
            foreach (var item in choiq)
            {
                if (item.Theme.TeaGroup.TG_Id == tg.TG_Id)
                {
                    //stuidlist.Add((int)item.Student.Stu_Id);
                    StuFile sf = sfser.GetStuFileByStu((int)item.Student.Stu_Id);
                    if (sf == null)
                    {
                        m++;
                    }
                    if (sf != null)
                    {
                        str = sf.Student.Stu_Name + "=" + sf.StuF_Name + "=" + sf.SubTime + "=" + sf.Url;
                        strlist.Add(str);
                    }
                }
            }
            //string str = "";

            //for (int i = 0; i < stuidlist.Count(); i++)
            //{
            //   StuFile sf = sfser.GetStuFileByStu(stuidlist[i]);
            //   if (sf == null)
            //   {
            //       m++;
            //   }
            //   if (sf!=null)
            //   {
            //        str = sf.Student.Stu_Name + "=" + sf.StuF_Name + "=" + sf.SubTime+"="+sf.Url;
            //        strlist.Add(str);
            //   }
            //}
            string outstr = js.Serialize(strlist);

            Response.Write(outstr);
            Response.End();
            return(null);
        }