コード例 #1
0
        /// <summary>
        /// 用户状态菜单控件
        /// </summary>
        /// <param name="spaceKey">空间标识</param>
        public ActionResult _UserStatus(string spaceKey)
        {
            User         user         = userService.GetUser(spaceKey) as User;
            CountService countService = new CountService(TenantTypeIds.Instance().User());
            int          countPerDay  = countService.GetStageCount(CountTypes.Instance().HitTimes(), 7, user.UserId);
            int          countAll     = countService.Get(CountTypes.Instance().HitTimes(), user.UserId);

            ViewData["accessedCount"] = countPerDay + "/" + countAll;

            VisitService        visitService = new VisitService(TenantTypeIds.Instance().User());
            IEnumerable <Visit> visits       = visitService.GetTopMyVisits(user.UserId, 1);

            if (visits != null && visits.FirstOrDefault() != null)
            {
                ViewData["lastVisitDate"] = visits.FirstOrDefault().LastVisitTime.ToFriendlyDate();
            }

            return(View(user));
        }
コード例 #2
0
        public ActionResult _DetailPhotoSide(long photoId)
        {
            Photo photo = photoService.GetPhoto(photoId);

            photo.Description = Formatter.FormatMultiLinePlainTextForEdit(photo.Description, false);
            //如果没有读到对象则返回空内容
            if (photo == null)
            {
                return(Content(string.Empty));
            }

            Dictionary <int, string> enabledEXIF = new Dictionary <int, string>();

            enabledEXIF.Add(0x010F, "设备制造厂商");
            enabledEXIF.Add(0x0110, "相机型号");
            enabledEXIF.Add(0x9003, "拍摄日期");
            enabledEXIF.Add(0xa002, "宽度");
            enabledEXIF.Add(0xa003, "高度");
            enabledEXIF.Add(0x9205, "最大光圈");
            enabledEXIF.Add(0x920a, "焦距");
            enabledEXIF.Add(0x829A, "曝光时间");
            enabledEXIF.Add(0x8824, "感光度");
            enabledEXIF.Add(0x9209, "闪光灯");

            ViewData["EnabledEXIF"] = enabledEXIF;

            ViewData["EXIFMetaData"] = photoService.GetPhotoEXIFMetaData(photoId);

            ViewData["PhotoLabels"] = photoService.GetLabelsOfPhoto(TenantTypeIds.Instance().User(), photoId);

            CountService countService = new CountService(TenantTypeIds.Instance().Photo());

            ViewData["CommentCount"] = countService.Get(CountTypes.Instance().CommentCount(), photoId);

            return(View(photo));
        }