/// <summary> /// 根据竞赛名称获取竞赛信息 /// </summary> /// <param name="name"></param> /// <returns></returns> public static ContestDll.Course GetCourseByName(string name) { using (ContestEntities db = new ContestEntities()) { ContestDll.Course c = db.Course.SingleOrDefault(p => p.CourseName == name); return(c); } }
public static long GetCourseID() { ContestDll.Course CourseDt = DAL.Course.GetCourseByName(DAL.Common.SPWeb.Title); if (CourseDt != null) { return(CourseDt.CourseID); } else { return(1); } }
public static long GetContestWebID() { string courseName = DAL.Common.SPWeb.Title; if (courseName == "众创竞赛") { return(0); } else { ContestDll.Course CourseDt = DAL.Course.GetCourseByName(courseName); if (CourseDt != null) { return(CourseDt.CourseID); } else { return(1); } } }