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")); }