Exemple #1
0
        protected void GetImageInfo(Guid itemId) {
            Resource rs = new Resource();
            ResourceEntity r = rs.GetResourceInfoByItemId(itemId.ToString());

            //更新浏览次数
            rs.UpdateResourceViewCount(itemId.ToString());


            ImageType obj = new ImageType();
            //yangguang
            //string yRootPath = obj.PreviewPath_400_Read; // 400预览图路径
            folderName = r.FolderName;
            serviceFileName = r.ServerFileName;
            //yRootPath = yRootPath + r.FolderName + @"/" + r.ServerFileName;
            string yRootPath = obj.GetPreviewPathRead(r.FolderName, r.ServerFileName, "400");
            folder = r.FolderName;

            //this.imgsrc.Src = yRootPath;
            this.lb_Description.Text = GetString(r.Description, 25);
            this.lb_FileName.Text = r.FileName;
            this.lb_Caption.Text = GetString(r.Caption, 25);
            this.lb_Author.Text = r.Author;
            this.lb_fileLength.Text = QJVRMS.Common.Tool.toFileSize(r.FileSize);
            this.lb_ImageType.Text = Path.GetExtension(r.FileName);
            this.lb_ItemSerialNum.Text = r.ItemSerialNum;
            this.lb_Keyword.Text = r.Keyword;
            this.lb_shotDate.Text = r.shotDate.ToString("yyyy-MM-dd");
            this.lb_uploadDate.Text = r.uploadDate.ToString("yyyy-MM-dd");
            this.pageTitle.Text = r.Caption;
            this.lb_viewCount.Text = r.ViewCount.ToString();
            string enableDate = "";
            if (r.StartDate.ToString("yyyy-MM-dd") != "1900-01-01") {
                enableDate += r.StartDate.ToString("yyyy-MM-dd");
            }
            enableDate += " -- ";
            if (r.EndDate.ToString("yyyy-MM-dd") != "1900-01-01") {
                enableDate += r.EndDate.ToString("yyyy-MM-dd");
            }

            this.lb_SN.Text = r.ItemSerialNum;
            //if (enableDate != " -- ") {
            //    this.lb_enableDate.Text = enableDate;
            //}

            //if (r.HasCopyright == 1) {
            //    this.pSource.Visible = false;
            //}
            //else {
            //    this.pSource.Visible = true;
            //}

            if (r.ResourceType.Equals("image")) {
                ImageInfo o = rs.GetImageInfoBySN(r.ItemSerialNum);
                if (o != null) {
                    switch (o.Hvsp.ToUpper()) {
                        case "H": this.lb_Hvsp.Text = "横图"; break;
                        case "V": this.lb_Hvsp.Text = "竖图"; break;
                        case "S": this.lb_Hvsp.Text = "方图"; break;
                        case "P": this.lb_Hvsp.Text = "全景图"; break;
                        default: this.lb_Hvsp.Text = "横图"; break;
                    }
                    this.lb_Size.Text = o.Width.ToString() + "x" + o.Height.ToString();
                }
            }

            StringBuilder OutString = new StringBuilder("");
            using (DataSet ds = GetResourceCatalog(itemId.ToString()))
            {
                if (ds != null && ds.Tables[0].Rows.Count != 0)
                {
                    DataTable cataTable = ds.Tables[0];

                    for (int i = 0; i < cataTable.Rows.Count; i++)
                    {
                        OutString.Append(cataTable.Rows[i]["CatalogName"].ToString() + "   ");
                    }

                    this.lb_Category.Text = OutString.ToString();

                }
            }



            //判断是否具有下载权限
            this.pDownload.Visible = IsSuperAdmin || rs.IsUserResource(CurrentUser.UserId, r.ItemId, (int)OperatorMethod.Download);
            this.pEdit.Visible = IsSuperAdmin || rs.IsUserResource(CurrentUser.UserId, r.ItemId, (int)OperatorMethod.Modify);
        }