using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class WebMain_Product_product : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.databind();
        }

    }
    public void databind()
    {       
        SqlConnection conn = CDatabase.wtoconn();
        conn.Open();
        SqlDataAdapter sda=new SqlDataAdapter("select * from ProductInfo where ISPublished='y' order by AddDate", conn);
        DataSet ds = new DataSet();
        sda.Fill(ds,"cu");
        this.prductpt.DataSource = Doadmin.ps(ds, Table1, Convert.ToInt32(xmlwebconfig.GetXMLvalue("pro", "inner", "small", "cou")), 0);//分页类调用
        this.prductpt.DataBind();
        this.prductpt.RepeatColumns = Convert.ToInt32(xmlwebconfig.GetXMLvalue("pro","inner","small","hh"));
        
        conn.Close();
    }

    public string SubStr(string sString, int nLeng)
    {
        if (sString.Length <= nLeng)
        {
            return sString;
        }
        string sNewStr = sString.Substring(0, nLeng);
        sNewStr = sNewStr + "...";
        return sNewStr;
    }
    public string getimgurl(string no)
    {
        return "fd";
    }

}
