예제 #1
0
    public void LoadAlbumList()
    {
        MyTool.Gallery obj = new MyTool.Gallery();
        if (_isAgentCat)
        {
            _agentCatID = Globals.AgentCatID;
        }
        DataSet ds        = obj.GetAllAlbum("GalleryAlbum", _agentCatID);
        string  detailUrl = "";
        int     AlbumID   = 0;
        string  img       = "";

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            AlbumID   = Convert.ToInt32(Convert.ToString(ds.Tables[0].Rows[i]["ID"]));
            detailUrl = "GalleryView.aspx?AlbumID=" + AlbumID;
            img       = obj.GetImageOfAlbumID(AlbumID);
            Response.Write("<div class=\"album_item\">");
            Response.Write("<a href=\"" + detailUrl + "\">");
            if (Globals.IsFileExistent(img))
            {
                Response.Write("<img class=\"imgalbum\" src=\"Thumbnail.ashx?Width=170&Height=150&ImgFilePath=" + Globals.GetUploadsUrl() + img + "\" />");
            }
            else
            {
                Response.Write("<img class=\"imgalbum\" src=\"" + Globals.DefaultImage + "\" />");
            }

            Response.Write("</a>");
            Response.Write("<div class=\"album_name\"><a href=\"" + detailUrl + "\">" + Convert.ToString(ds.Tables[0].Rows[i]["AlbumName"]) + "</a></div>");
            Response.Write("</div>");
        }
    }
예제 #2
0
    private void LoadData()
    {
        string html = "";
        string Lang = Globals.GetLang();

        MyTool.Gallery obj      = new MyTool.Gallery();
        DataSet        ds       = obj.GetAllPhoto("GalleryPhoto", Globals.AgentCatID);
        string         styleImg = "width: " + _imageWidth + ", height: " + _imageHeight;

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            string detailUrl = "GalleryView.aspx?AlbumID=" + DataObject.GetString(ds, i, "AlbumID") + "&Lang=" + Lang;
            html += "<img style=\"" + styleImg + "\" src=\"Thumbnail.ashx?Width=" + _imageWidth + "&Height=" + _imageHeight + "&ImgFilePath=" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "PhotoUrl") + "\" />";
        }
        divContent.InnerHtml = html;
    }
예제 #3
0
    public void LoadPhotoList()
    {
        MyTool.Gallery obj     = new MyTool.Gallery();
        int            AlbumID = Globals.GetIntFromQueryString("AlbumID");
        DataSet        ds      = new DataSet();

        if (AlbumID != -1)
        {
            ds = obj.GetPhotoByAlbumID("GalleryPhoto", Globals.AgentCatID, AlbumID);
        }
        else
        {
            ds = obj.GetAllPhoto("GalleryPhoto", Globals.AgentCatID);
        }

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            string imgSrc = Globals.GetUploadsUrl() + Convert.ToString(ds.Tables[0].Rows[i]["PhotoUrl"]);
            Response.Write("<a href=\"" + imgSrc + "\" onclick=\"return hs.expand(this)\" >");
            Response.Write("<img src=\"Thumbnail.ashx?Width=170&Height=150&ImgFilePath=" + imgSrc + "\" />");
            Response.Write("</a>");
        }
    }