コード例 #1
0
        /// <summary>
        /// Gets the day.
        /// </summary>
        /// <param name="selectedMonth">The selected month.</param>
        /// <returns></returns>
        public static IEnumerable <SelectListItem> GetMonths(int?selectedMonth = null)
        {
            IList <Months> daysInMonth = EnumerationsExtensions.GetValues <Months>();

            List <SelectListItem> months = daysInMonth.Select(o => new SelectListItem
            {
                Selected = (selectedMonth.HasValue && selectedMonth.Value == ((int)o)),
                Text     = Convert.ToString(o),
                Value    = ((int)o).ToString()
            }).ToList();

            months.Insert(0, new SelectListItem {
                Text = "", Value = ""
            });

            return(months);
        }
コード例 #2
0
        /// <summary>
        /// Loads the Index View
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            List <RecentActivityByUser> retrieveLastSevenDaysOfFriendsActivity = _recentActivity.RetrieveLastSevenDaysOfFriendsActivity(Owner.Id);
            string recentFriends = RenderRecentFriends(retrieveLastSevenDaysOfFriendsActivity);
            IDictionary <string, string> crumbs          = HomeBreadCrumb();
            IList <CommentStatus>        commentStatuses = EnumerationsExtensions.GetValues <CommentStatus>();

            DashboardView dashboardView = new DashboardView
            {
                RecentFriendActivity = recentFriends,
                Comments             = GetCommentCounts(commentStatuses),
                SiteStats            = _reportingRepository.SiteStatistics(Owner.Id),
                TopTenViewed         = _reportingRepository.GetTopTenViewedPhotos(Owner.Id)
            };

            dashboardView = SetAuthorizationAndUrlService(dashboardView);
            return(View(dashboardView, crumbs));
        }