private void UpdateCommonViewWithPresenters(CommonViewModel commonViewModel, int codeCampYearId) { commonViewModel.Speakers = AttendeesManager.I.GetSpeakerResults(new AttendeesQuery() { CodeCampYearId = codeCampYearId, PresentersOnly = true, IncludeSessions = true }); }
private void UpdateCommonViewWithSessions(CommonViewModel commonViewModel, int codeCampYearId) { var sessions = SessionsManager.I.Get(new SessionsQuery { CodeCampYearId = codeCampYearId, WithInterestOrPlanToAttend = true, WithLectureRoom = true, WithSpeakers = true, WithTags = true, //Attendeesid = 1164 // nima }); commonViewModel.Sessions = sessions; commonViewModel.SessionsByTime = ControllerUtils.SessionTimesResultsWithSessionInfo(codeCampYearId, sessions); commonViewModel.SessionTimeResults = SessionTimesManager.I.Get(new SessionTimesQuery { CodeCampYearId = codeCampYearId }); commonViewModel.TagsResults = TagsManager.I.Get(new TagsQuery { CodeCampYearId = codeCampYearId }); }
public static CommonViewModel GetCommonViewModelOneSession(string session, CommonViewModel commonViewModel) { List<SessionsResult> sessionsTemp = commonViewModel.Sessions; var sessionSlugsDict = new Dictionary<string, int>(); foreach (SessionsResult result in sessionsTemp) { if (!sessionSlugsDict.ContainsKey(result.SessionSlug)) { sessionSlugsDict.Add(result.SessionSlug, result.Id); } } var sessions = new List<SessionsResult>(); if (sessionSlugsDict.ContainsKey(session)) { SessionsResult sessionsResult = sessionsTemp.FirstOrDefault(a => a.Id == sessionSlugsDict[session]); if (sessionsResult != null) { sessions = commonViewModel.Sessions.Where(a => a.Id == sessionsResult.Id).ToList(); } } commonViewModel.Sessions = sessions; return commonViewModel; }
/// <summary> /// takes in int codeCampYearId (presumably as method call) and returns it for later use /// </summary> /// <param name="viewModel"></param> /// <param name="codeCampYearId"></param> /// <param name="codeCampYearIdOut"></param> /// <returns></returns> public static CommonViewModel UpdateViewModel(CommonViewModel viewModel, int codeCampYearId, out int codeCampYearIdOut) { codeCampYearIdOut = codeCampYearId; return UpdateViewModel(viewModel, codeCampYearId); }
/// <summary> /// Adds Jobs,RSSFeed,Sponsors to CommonViewModel /// </summary> /// <param name="viewModel"></param> /// <param name="codeCampYearId"></param> /// <returns></returns> public static CommonViewModel UpdateViewModel(CommonViewModel viewModel, int codeCampYearId) { viewModel.JobListings = JobsTop(); viewModel.FeedItems = FeedItems(); viewModel.Sponsors = AllSponsors(codeCampYearId); return viewModel; }