Ejemplo n.º 1
0
    private void LoadData()
    {
        string html = "";
        string Lang = Globals.GetLang();

        MyTool.Customer obj = new MyTool.Customer();
        DataSet         ds  = obj.GetAllCustomer("Customer", Globals.AgentCatID);

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            //string detailUrl = "GalleryView.aspx?AlbumID=" + DataObject.GetString(ds, i, "AlbumID") + "&Lang=" + Lang;
            string link = DataObject.GetString(ds, i, "CustomerWebsite");
            if (link != "" && link != "#")
            {
                if (link.Contains("http://") == false)
                {
                    link = "http://" + link;
                }
            }
            else
            {
                html += "<a href=\"javascript:;\">";
            }

            html += "<img width='" + _imageWidth + "' height='" + _imageHeight + "' src=\"Thumbnail.ashx?Width=" + _imageWidth + "&Height=" + _imageHeight + "&ImgFilePath=" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "CustomerLogo") + "\" onclick=\"window.open('" + link + "', 'CtrlWindow', 'width=1024,height=700,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes');\" />";
        }
        divContent.InnerHtml = html;
    }
Ejemplo n.º 2
0
    public void LoadCustomer()
    {
        MyTool.Customer cust       = new MyTool.Customer();
        DataSet         ds         = cust.GetAllCustomer("Customer", Globals.AgentCatID);
        int             TotalItems = ds.Tables[0].Rows.Count;

        if (TotalItems % PageSize == 0)
        {
            PageCount = TotalItems / PageSize;
        }
        else
        {
            PageCount = TotalItems / PageSize + 1;
        }

        Int32 Page = Globals.GetIntFromQueryString("Page");

        if (Page == -1)
        {
            Page = 1;
        }
        int FromRow = (Page - 1) * PageSize;
        int ToRow   = Page * PageSize - 1;

        if (ToRow >= TotalItems)
        {
            ToRow = TotalItems - 1;
        }
        string aHrefStart = "";
        string aHrefEnd   = "</a>";

        for (int i = FromRow; i <= ToRow; i++)
        {
            string link = Convert.ToString(ds.Tables[0].Rows[i]["CustomerWebsite"]);
            if (link == "" || link == "#")
            {
                aHrefStart += "<a href=\"javascript:;\">";
            }
            else
            {
                if (link.Contains("http://") == false)
                {
                    aHrefStart += "<a target=\"_blank\" href=\"http://" + link + "\">";
                }
                else if (link.Contains("http://") == true)
                {
                    aHrefStart += "<a target=\"_blank\" href=\"" + link + "\">";
                }
            }

            Response.Write("<div class=\"customer-item\">");
            Response.Write("<strong style=\"display:block; width:100%; height:33px; overflow:hidden\">");
            Response.Write(aHrefStart + DataObject.GetString(ds, i, "CustomerFullName") + aHrefEnd);
            Response.Write("</strong>");
            Response.Write(aHrefStart);
            if (Globals.IsFileExistent(Convert.ToString(ds.Tables[0].Rows[i]["CustomerLogo"])))
            {
                Response.Write("<img width=\"" + _imageWidth + "\" height=\"" + _imageHeight + "\" src=\"Thumbnail.ashx?width=" + _imageWidth + "&height=" + _imageHeight + "&ImgFilePath=" + Globals.GetUploadsUrl() + Convert.ToString(ds.Tables[0].Rows[i]["CustomerLogo"]) + "\" />");
            }
            else
            {
                Response.Write("<img width=\"" + _imageWidth + "\" height=\"" + _imageHeight + "\" src=\"" + Globals.DefaultImage + "\" />");
            }
            Response.Write(aHrefEnd);
            //Response.Write("<p style=\"width:100%;\">");
            //Response.Write("<strong style=\"display:block; width:100%;\">" + DataObject.GetString(ds, i, "CustomerFullName") + "</strong>");
            //Response.Write("<span>Website: ");


            //Response.Write("</a>");
            //Response.Write("</span>");
            //Response.Write("</p>");
            Response.Write("</div>");
        }
    }