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; }
public static Course GetCourseBLLInstance() { //如实例不存在,则New一个新实例,否则返回已有实例 if (CourseBLLInstance == null) { lock (syncRootCourse) { if (CourseBLLInstance == null) CourseBLLInstance = new Course(); } } return CourseBLLInstance; }
public static string GetCourseName(int id) { var bll = new Course(); return bll.GetModel(id).Name; }
public static decimal GetCourseGpa(int id) { var bll = new Course(); return decimal.Parse(bll.GetModel(id).Credit.ToString()); }