示例#1
0
        public ActionResult GetAllProByDep()
        {
            ProfessionDal           prod = new ProfessionDal();
            string                  dep  = Request["dep"];
            IQueryable <Profession> iq   = prod.GetEntities(u => u.Department.Dep_Name == dep);
            string                  str  = "";

            foreach (var item in iq)
            {
                str = str + item.Pro_Name + "-";
            }
            //string str = js.Serialize(iq);
            Response.Write(str);
            Response.End();
            return(View());
        }
示例#2
0
        public ActionResult GetPro()
        {
            Teacher tea = (Teacher)Session["teacher"];

            if (tea == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            DepartmentService deps = new DepartmentService();

            ProfessionDal           prod = new ProfessionDal();
            IQueryable <Profession> iq   = prod.GetEntities(u => u.Department.Dep_Id == tea.Department.Dep_Id);
            string str = "";

            foreach (var item in iq)
            {
                str = str + item.Pro_Name + "-";
            }
            Response.Write(str);
            Response.End();
            return(View());
        }
示例#3
0
        public ActionResult AddTheme()
        {
            Teacher tea = (Teacher)Session["teacher"];

            if (tea == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            string ketiming        = Request["ketiming"];
            string xianxuanzhuanye = Request["xianxuanzhuanye"];
            // int xianxuanrenshu = Convert.ToInt32(Request["xianxuanrenshu"]);
            string ketijieshao = Request["ketijieshao"];
            Theme  theme       = new Theme();

            theme.Theme_Name = ketiming;
            // theme.CountStu = xianxuanrenshu;
            theme.Department = tea.Department;
            theme.Introduce  = ketijieshao;
            ProfessionDal           prod = new ProfessionDal();
            Profession              p    = new Profession();
            IQueryable <Profession> iq   = prod.GetEntities(u => u.Pro_Name == xianxuanzhuanye);

            foreach (var item in iq)
            {
                p = item;
            }
            theme.Profession = p;
            theme.SubTime    = DateTime.Now;
            theme.Teacher    = tea;
            theme.TeaGroup   = tea.TeaGroup;
            theme.Examine    = 0;
            //theme.ExamineStatus=1;
            theme.ExamineTime = DateTime.Now;
            ThemeService themeservice = new ThemeService();

            themeservice.AddTheme(theme);

            return(RedirectToAction("Index", "Teacher"));
        }