// GET: Dashboard public ActionResult Index() { int UserIDX = db_Accounts.GetUserIDX(); var model = new vmDashboardIndex(); model.UserBadges = db_Forum.GetBadgesForUser(UserIDX); //badge progress model.ProjectsNeedingReviewCount = db_EECIP.GetT_OE_PROJECTS_NeedingReviewCount(UserIDX); //projects needing review model.UserPointLeaders = db_Forum.GetMembershipUserPoints_MostPoints(6); //user point leaders model.LatestProjects = db_EECIP.GetT_OE_PROJECTS_RecentlyUpdatedMatchingInterest(UserIDX); //latest projects model.LatestTopics = db_Forum.GetLatestTopicPostsMatchingInterest(UserIDX); //latest topics matching interest model.ProjectCount = db_EECIP.GetT_OE_PROJECTS_CountNonGovernance(); model.GovernanceCount = db_EECIP.GetT_OE_PROJECTS_CountGovernance(); model.DiscussionCount = db_Forum.GetTopicCount(); model.AgencyCount = db_Ref.GetT_OE_ORGANIZATION_Count(); model.UserBadgeEarnedCount = db_Forum.GetBadgesForUserCount(UserIDX); model.Announcement = db_Ref.GetT_OE_APP_SETTING_CUSTOM().ANNOUNCEMENTS; T_OE_USERS u = db_Accounts.GetT_OE_USERSByIDX(UserIDX); if (u != null) { model.UserName = u.FNAME + " " + u.LNAME; } return(View(model)); }
// GET: Dashboard public ActionResult Index(string selSub) { int UserIDX = db_Accounts.GetUserIDX(); var model = new vmDashboardIndex { UserBadges = db_Forum.GetBadgesForUser(UserIDX), //badge progress ProjectsNeedingReviewCount = db_EECIP.GetT_OE_PROJECTS_NeedingReviewCount(UserIDX), //projects needing review UserPointLeaders = db_Forum.GetMembershipUserPoints_MostPoints(6), //user point leaders UserPointLeadersMonth = db_Forum.GetMembershipUserPoints_MostPoints(6, System.DateTime.Today.AddDays(-30), System.DateTime.Now.AddDays(1)), LatestProjects = db_EECIP.GetT_OE_PROJECTS_RecentlyUpdatedMatchingInterest(UserIDX, 900, true, 6, (selSub == "Default View" ? null : selSub)), //latest projects matching interest LatestTopics = db_Forum.GetLatestTopicPostsMatchingInterestNew(UserIDX, 900, 6, (selSub == "Default View" ? null : selSub)), //latest topics matching interest ProjectCount = db_EECIP.GetT_OE_PROJECTS_CountNonGovernance(), GovernanceCount = db_EECIP.GetT_OE_PROJECTS_CountGovernance(), DiscussionCount = db_Forum.GetTopicCount(null), AgencyCount = db_Ref.GetT_OE_ORGANIZATION_Count(), UserBadgeEarnedCount = db_Forum.GetBadgesForUserCount(UserIDX), Announcement = db_Ref.GetT_OE_APP_SETTING_CUSTOM().ANNOUNCEMENTS, ddl_Subscriptions = db_EECIP.GetT_OE_USER_EXPERTISE_ByUserIDX_withDefault(UserIDX).Select(x => new SelectListItem { Value = x, Text = x }), selSub = (selSub ?? "Default View") }; //fallback on topics model.TopicMatchInd = (model.LatestTopics != null && model.LatestTopics.Count > 0); if (model.TopicMatchInd == false) { model.LatestTopics = db_Forum.GetLatestTopicPostsFallback(900, 6); } T_OE_USERS u = db_Accounts.GetT_OE_USERSByIDX(UserIDX); if (u != null) { model.UserName = u.FNAME + " " + u.LNAME; } return(View(model)); }