Example #1
0
 public static Decimal GetGpa(int CourseId, decimal score)
 {
     var bllCourse = new Course();
     int credit = Convert.ToInt16(bllCourse.GetModel(CourseId).Credit);
     if (score<60)
     {
         return 0;
     }
     decimal Gpa = (score / 10 - 5) * credit;
     return Gpa;
 }
Example #2
0
 public static Course GetCourseBLLInstance()
 {
     //如实例不存在,则New一个新实例,否则返回已有实例
     if (CourseBLLInstance == null)
     {
         lock (syncRootCourse)
         {
             if (CourseBLLInstance == null)
                 CourseBLLInstance = new Course();
         }
     }
     return CourseBLLInstance;
 }
Example #3
0
 public static string GetCourseName(int id)
 {
     var bll = new Course();
     return bll.GetModel(id).Name;
 }
Example #4
0
 public static decimal GetCourseGpa(int id)
 {
     var bll = new Course();
     return decimal.Parse(bll.GetModel(id).Credit.ToString());
 }