public static string StudentForClass(string Grade, string Subject, string currCourseName) { Thinkgate.Classes.SessionObject SessionObject = (Thinkgate.Classes.SessionObject)System.Web.HttpContext.Current.Session["SessionObject"]; CourseList curriculumCourseList = new CourseList(); curriculumCourseList = Thinkgate.Base.Classes.CourseMasterList.GetCurrCoursesForUser(SessionObject.LoggedInUser); var coursesByGradeAndSubject = curriculumCourseList.FilterByGradeAndSubject(Grade, Subject); coursesByGradeAndSubject.Sort((x, y) => string.Compare(x.CourseName, y.CourseName)); int currCourseID = 0; foreach (var c in coursesByGradeAndSubject) { if (c.CourseName == currCourseName) { currCourseID = c.ID; } } string groupName = "groupName"; Guid? myGroupName = groupName == "groupName" ? Guid.Empty : new Guid(groupName); return CompetencyWorkSheet.GetCompetencyWorksheetStudendCount(currCourseID, myGroupName, SessionObject.LoggedInUser.UserId).ToJSON(false); }