Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataTable dt = goodsBLL.GetAllGood();
         Repeater1.DataSource = dt;
         Repeater1.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataTable goodsTable  = goodBLL.GetAllGood();
         DataTable storebTable = storeBLL.GetAllStore();
         gno.DataSource     = goodsTable;
         gno.DataTextField  = "gname";
         gno.DataValueField = "gno";
         gno.DataBind();
         stno.DataSource    = storebTable;
         stno.DataTextField = stno.DataValueField = "stno";
         stno.DataBind();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable     goodTable      = goodBLL.GetAllGood();
                DataTable     queryDataTable = inventBLL.QueryCharts();
                StringBuilder strJson        = new  StringBuilder();
                strJson.Append("[");
                for (int i = 0; i < queryDataTable.Rows.Count; i++)
                {
                    strJson.Append("{");
                    strJson.Append("name:\"" + goodTable.Rows[i]["gname"] + "\",");
                    strJson.Append("value:" + queryDataTable.Rows[i]["sumNumber"].ToString());
                    strJson.Append("},");
                }

                /*
                 * select g.gno,(case  when SUM(i.number) IS NULL  then 0 else SUM(i.number) end ) as sumNumber
                 * from goods g left join invent i on g.gno = i.gno group by g.gno
                 */
                sumNumber  = strJson.ToString().TrimEnd(',');
                sumNumber += "]";
            }
        }