Пример #1
0
    protected void PopulateControls()
    {
        string    date   = Session["TodayDate"].ToString();
        int       userId = Int32.Parse(Session["UserID"].ToString());
        DataTable dt     = ItemAccess.GetFenLeiZongJiList(date, userId);

        string value = "";

        if (dt.Rows.Count > 0 && Double.Parse(dt.Rows[0]["ItemPriceTotal"].ToString()) > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                if (Double.Parse(dr["ItemPriceTotal"].ToString()) > 0)
                {
                    value += "{\"value\":" + dr["ItemPriceTotal"].ToString() + ",\"label\":\"" + dr["CategoryTypeName"].ToString() + "\",\"text\":\"" + dr["CategoryTypeName"].ToString() + "\"},";
                }
            }

            value = value.Remove(value.Length - 1);
        }
        else
        {
            value = "{\"value\":100,\"label\":\"空记录\",\"text\":\"空记录\"}";
        }

        Response.Write(GetChartJsonString(value));
        Response.End();
    }
Пример #2
0
    protected void PopulateControls()
    {
        DataTable dt = ItemAccess.GetFenLeiZongJiList(today, userId);

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

        double priceTotal = 0;

        foreach (DataRow dr in dt.Rows)
        {
            priceTotal += Double.Parse(dr["ItemPriceTotal"].ToString());
        }

        this.Label2.Text = priceTotal.ToString("0.0##");

        this.hidChartData.Value = ItemHelper.GetChartData(dt, "PageUrl");
    }