예제 #1
0
    protected void PopulateControls()
    {
        double    priceMax = 0;
        int       countMax = 0;
        DataTable dt       = ItemAccess.GetBiJiaoMingXiList(catTypeId, today, userId, out priceMax, out countMax);

        CatTypeList.DataSource = dt;
        CatTypeList.DataBind();

        this.hidChartData.Value  = ItemHelper.GetChartData(dt, "PageUrlCur");
        this.hidChartData2.Value = ItemHelper.GetChartData(dt, "PageUrlPrev");
    }
예제 #2
0
    protected void PopulateControls()
    {
        int       catTypeId = Int32.Parse(Request.QueryString["catTypeId"]);
        string    today     = Session["TodayDate"].ToString();
        int       userId    = Int32.Parse(Session["UserID"].ToString());
        double    priceMax  = 0;
        int       countMax  = 0;
        DataTable dt        = ItemAccess.GetBiJiaoMingXiList(catTypeId, today, userId, out priceMax, out countMax);

        string max           = "1";
        string step          = "1";
        string max2          = "1";
        string step2         = "1";
        string itemName      = "";
        string itemPriceCur  = "";
        string itemPricePrev = "";
        string countNumCur   = "";
        string countNumPrev  = "";

        if (dt.Rows.Count > 0)
        {
            max   = Math.Floor(priceMax).ToString();
            step  = Math.Floor(Double.Parse(max) / 10).ToString();
            max2  = countMax.ToString();
            step2 = Math.Floor(Double.Parse(max2) / 10).ToString();

            int i = 0;
            foreach (DataRow dr in dt.Rows)
            {
                if (i == 15)
                {
                    break;
                }
                string dot = (i < 15 - 1 && i < dt.Rows.Count - 1 ? "," : "");
                itemName      += "{\"text\":\"" + dr["ItemName"].ToString() + "\",\"rotate\":0}" + dot;
                itemPriceCur  += dr["ItemPriceCur"].ToString() + dot;
                itemPricePrev += dr["ItemPricePrev"].ToString() + dot;
                countNumCur   += dr["CountNumCur"].ToString() + dot;
                countNumPrev  += dr["CountNumPrev"].ToString() + dot;
                i++;
            }
        }

        Response.Write(GetChartJsonString(itemName, itemPriceCur, itemPricePrev, countNumCur, countNumPrev, max, step, max2, step2));
        Response.End();
    }