示例#1
0
        /// <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);
            }
        }
示例#2
0
 public static long GetCourseID()
 {
     ContestDll.Course CourseDt = DAL.Course.GetCourseByName(DAL.Common.SPWeb.Title);
     if (CourseDt != null)
     {
         return(CourseDt.CourseID);
     }
     else
     {
         return(1);
     }
 }
示例#3
0
        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);
                }
            }
        }