public void DeleteTg(int tgid) { TeacherDal teadal = new TeacherDal(); DBSession db = new DBSession(); ThemeDal thdal = new ThemeDal(); IQueryable <TeaGroup> iq = tgdal.GetEntities(u => u.TG_Id == tgid); TeaGroup tg = new TeaGroup(); foreach (var item in iq) { tg = item; } if (tgdal.DeleteEntity(tg) != null) { IQueryable <Teacher> tiq = teadal.GetEntities(u => u.TeaGroup == tg); foreach (var item in tiq) { item.TeaGroup = null; } IQueryable <Theme> theiq = thdal.GetEntities(u => u.TeaGroup == tg); foreach (var item in theiq) { item.TeaGroup = null; } } ; db.SaveChanges(); }
/// <summary> /// 返回审批通过的所有论文课题 /// </summary> /// <returns></returns> public IQueryable <Theme> GetAllPassedTheme() { return(themedal.GetEntities(u => u.Examine == 1)); }