Exemplo n.º 1
0
        public ActionResult StuXuanzeTheme()
        {
            Student           stu       = (Student)Session["student"];
            string            themename = Request["ketiming"];
            ThemeService      theser    = new ThemeService();
            ChoseThemeService choseser  = new ChoseThemeService();

            if (choseser.GetStuChoseTheme((int)stu.Stu_Id) != null)//没有选过就为true
            {
                Response.Write("不能选择过个课题");
                Response.End();
                return(View());
            }
            ;

            Theme      theme      = theser.GetThemeByThemeName(themename);
            ChoseTheme chosetheme = new ChoseTheme();

            chosetheme.Student = stu;
            chosetheme.Theme   = theme;
            chosetheme.Teacher = theme.Teacher;
            chosetheme.SubTime = DateTime.Now;
            if (choseser.AddChoseTheme(chosetheme))
            {
                TeacherService ter = new TeacherService();
                ter.UpdateTeaAddCount(theme.Teacher);
                Response.Write("选题成功");
                Response.End();
                return(View());
            }
            ;
            Response.Write("选题未成功");
            Response.End();
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult GetAllTea()
        {
            Student              stu     = (Student)Session["student"];
            string               s       = "";
            TeacherService       teaser  = new TeacherService();
            ChoseThemeService    choser  = new ChoseThemeService();
            IQueryable <Teacher> tealist = teaser.GetAllTeaByDep((int)stu.Department.Dep_Id);
            List <Teacher>       tl      = tealist.ToList <Teacher>();

            for (int i = 0; i < tl.Count(); i++)
            {
                int status = 1;

                if (tl[i].Tea_ChoseCount >= tl[i].Tea_StuCount)
                {
                    status = 0;
                }
                s = s + tl[i].Tea_Name + "=" + status + "-";
            }
            //foreach (var item in tealist)
            //{
            //    int status=1;
            //    IQueryable<ChoseTheme> iq = choser.GetChosedThemeByTeacher((int)item.Tea_Id);
            //    if (iq.Count()>=item.Tea_StuCount)
            //    {
            //        status = 0;
            //    }
            //    s = s + item.Tea_Name + "=" + status+"-";
            //}
            Response.Write(s);
            Response.End();
            return(View());
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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());
        }
Exemplo n.º 5
0
        public ActionResult GetMyStu()
        {
            Teacher                 tea          = (Teacher)Session["teacher"];
            ChoseThemeService       choseservice = new ChoseThemeService();
            IQueryable <ChoseTheme> list         = choseservice.GetChosedThemeByTeacher((int)tea.Tea_Id);
            IList <string>          liststr      = new List <string>();
            string str = "";

            foreach (var item in list)
            {
                str = item.Student.Stu_Name + "-" + item.Theme.Theme_Name + "-" + item.SubTime;
                liststr.Add(str);
            }
            string str1 = js.Serialize(liststr);

            Response.Write(str1);
            Response.End();
            return(View());
        }
Exemplo n.º 6
0
        public ActionResult GetMyTheme()
        {
            Session["filestyle"] = "开题报告";
            Student           stu      = (Student)Session["student"];
            ChoseThemeService choseser = new ChoseThemeService();
            ChoseTheme        ct       = choseser.GetStuChoseTheme((int)stu.Stu_Id);

            if (ct == null)
            {
                Response.Write("");
                Response.End();
                return(View());
            }
            string str = ct.Teacher.Tea_Name + "-" + ct.Teacher.Tea_Tel + "-" + ct.Teacher.Tea_Email + "-" + ct.Theme.Theme_Name + "-" + ct.Theme.TeaGroup.TG_Name + "-" + ct.Theme.Introduce;

            Response.Write(str);
            Response.End();
            return(View());
        }
Exemplo n.º 7
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());
        }