public ActionResult ActivityDetails(int professorId, int activityId) { Activity currentActivity = activityServices.GetActivity(activityId); List <Student> activityStudents = activityServices.GetStudents(currentActivity).ToList(); ActivityDetailsVM activityDetails = new ActivityDetailsVM { Id = currentActivity.Id, Name = currentActivity.Name, OccurenceDates = currentActivity.OccurenceDates, Students = new List <ActivityStudentVM>() }; activityStudents.ToList().ForEach(stud => { IEnumerable <ActivityInfo> studentActivityInfos = studentServices.GetActivityInfos(stud.Id, activityId); ICollection <ActivityStudentInfoVM> studentInfos = new List <ActivityStudentInfoVM>(); studentActivityInfos.ToList().ForEach(actInfo => { studentInfos.Add(new ActivityStudentInfoVM { Id = actInfo.Id, OccurenceDate = actInfo.OccurenceDate.OccurenceDate, Grade = actInfo.Grade, Presence = actInfo.Presence }); }); activityDetails.Students.Add(new ActivityStudentVM { Id = stud.Id, FirstName = stud.FirstName, LastName = stud.LastName, ActivityInfos = studentInfos }); }); return(View(activityDetails)); }
public ActivityDetails() { InitializeComponent(); BrowserActivityCharts.JavascriptMessageReceived += _OnBrowserJavascriptMessageReceived; _VM = DataContext as ActivityDetailsVM; }