Ejemplo n.º 1
0
    private void PopulateControls()
    {
        int     pageNumber    = 1;
        int     pagePerNumber = Convert.ToInt32(WebConfiguration.PagePerNumber);
        decimal priceMax      = 0m;

        DataTable lists = bll.GetJiaGeFenXiMingXiList(userId, itemType, itemName, pageNumber, pagePerNumber, out howManyItems, out priceMax);

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

        this.hidChartData.Value = ItemHelper.GetChartData(lists, "ItemBuyDate");
    }
Ejemplo n.º 2
0
    private void PopulateControls()
    {
        int     userId        = Convert.ToInt32(Session["UserID"]);
        string  itemType      = Request.QueryString["itemType"] ?? "";
        string  itemName      = Request.QueryString["itemName"] ?? "";
        int     pageNumber    = 1;
        int     pagePerNumber = Convert.ToInt32(WebConfiguration.PagePerNumber);
        int     howManyItems  = 0;
        decimal priceMax      = 0m;

        MonthBLL  bll = new MonthBLL();
        DataTable dt  = bll.GetJiaGeFenXiMingXiList(userId, itemType, itemName, pageNumber, pagePerNumber, out howManyItems, out priceMax);

        string max         = "1";
        string step        = "1";
        string itemBuyDate = "";
        string itemPrice   = "";

        if (dt.Rows.Count > 0)
        {
            max  = Math.Floor(priceMax).ToString();
            step = Math.Floor(Convert.ToDouble(max) / 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 ? "," : "");
                itemBuyDate += "{\"text\":\"" + Convert.ToDateTime(dr["ItemBuyDate"]).ToString("yyyy-MM-dd") + "\",\"rotate\":90}" + dot;
                itemPrice   += dr["ItemPrice"].ToString() + dot;
                i++;
            }
        }

        Response.Write(GetChartJsonString(itemBuyDate, itemPrice, max, step));
        Response.End();
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["page"] != "" && Request.QueryString["page"] != null)
        {
            int     userId        = Convert.ToInt32(Session["UserID"]);
            string  itemType      = Request.QueryString["itemType"] ?? "";
            string  itemName      = Request.QueryString["itemName"] ?? "";
            int     pageNumber    = Convert.ToInt32(Request.QueryString["page"]);
            int     pagePerNumber = Convert.ToInt32(WebConfiguration.PagePerNumber);
            int     howManyItems  = 0;
            decimal priceMax      = 0m;

            StringBuilder items = new StringBuilder();
            items.Append("[");

            MonthBLL  bll = new MonthBLL();
            DataTable dt  = bll.GetJiaGeFenXiMingXiList(userId, itemType, itemName, pageNumber, pagePerNumber, out howManyItems, out priceMax);
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    items.Append("{");
                    items.Append("\"RowNumber\":" + "\"" + dr["RowNumber"].ToString() + "\",");
                    items.Append("\"ItemName\":" + "\"" + dr["ItemName"].ToString() + "\",");
                    items.Append("\"ItemBuyDate\":" + "\"" + Convert.ToDateTime(dr["ItemBuyDate"]).ToString("yyyy-MM-dd") + "\",");
                    items.Append("\"ItemPrice\":" + "\"" + Convert.ToDouble(dr["ItemPrice"]).ToString("0.0##") + "\"");
                    items.Append("},");
                }
                items.Remove(items.ToString().LastIndexOf(','), 1);
            }

            items.Append("]");

            Response.Write(items.ToString());
            Response.End();
        }
    }