Exemplo n.º 1
0
        //按文件编号查询,获取图片详细信息
        public void SearchItemSerialNum(string imgItemSerialNum)
        {
            IImageStorage oIImageStorage = null;


            try
            {
                //oIImageStorage = ImageStorageClass.GetImageInfoByNum(imgItemSerialNum);
                oIImageStorage = ImageStorageClass.GetImageInfoByItemId(new Guid(imgItemSerialNum), CurrentUser.UserId);



                this.yRootPath = UIBiz.CommonInfo.GetImageUrl(400, oIImageStorage);

                string imgSuffixStr = ",JPG,JPEG,GIF,BMP,TIFF,PCX,TGA,EXIF,FPX,";
                if (imgSuffixStr.IndexOf("," + oIImageStorage.ImageType.ToUpper() + ",") < 0)
                {
                    this.tr_Hvsp.Visible     = false;
                    this.tr_shotDate.Visible = false;
                }

                this.imgsrc.Src             = yRootPath;
                this.Hidden_ImgItemId.Value = oIImageStorage.ItemId.ToString();
                hiImgNum.Value           = oIImageStorage.ItemSerialNum;
                this.TxtDescription.Text = oIImageStorage.Description;
                this.lb_FileName.Text    = oIImageStorage.FileName;
                switch (oIImageStorage.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_ImageType.Text     = oIImageStorage.ImageType.ToUpper();
                this.lb_ItemSerialNum.Text = oIImageStorage.ItemSerialNum;
                this.TxtKeyword.Text       = oIImageStorage.Keyword;
                this.lb_uploadDate.Text    = oIImageStorage.uploadDate.ToString("yyyy-MM-dd");
                //
                this.txt_Caption.Text   = oIImageStorage.Caption;
                this.txt_Address.Text   = oIImageStorage.Address;
                this.txt_Character.Text = oIImageStorage.Character;
                this.hiFolder.Value     = oIImageStorage.FolderName;

                if (oIImageStorage.StartDate.ToString("yyyy-MM-dd") != "1900-01-01")
                {
                    this.Calendar_StartDate.Text = oIImageStorage.StartDate.ToString("yyyy-MM-dd");
                }
                else
                {
                    this.Calendar_StartDate.Text = "";
                }
                if (oIImageStorage.EndDate.ToString("yyyy-MM-dd") != "1900-01-01")
                {
                    this.Calendar_EndDate.Text = oIImageStorage.EndDate.ToString("yyyy-MM-dd");
                }
                else
                {
                    this.Calendar_EndDate.Text = "";
                }
                if (oIImageStorage.shotDate.ToString("yyyy-MM-dd") != "1900-01-01")
                {
                    this.Calendar_ShotDate.Text = oIImageStorage.shotDate.ToString("yyyy-MM-dd");
                }
                else
                {
                    this.Calendar_ShotDate.Text = "";
                }

                using (DataSet ds = GetImageCatalog(oIImageStorage.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() + "   ");
                        }

                        lb_catalogs.Text = OutString.ToString();
                    }
                }
            }
            catch
            {
                this.imagePanel.Visible = false;
                Response.Write("<script language='javascript'>alert('不存在此图片!');window.close();</script>");
                Response.End();
            }
        }