private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetQuJianTongJiList(userId); string value = ""; string itemName = ""; if (dt.Rows.Count > 0) { int i = 0; foreach (DataRow dr in dt.Rows) { DateTime d1 = Convert.ToDateTime(dr["ItemBuyDate"]); DateTime d2 = Convert.ToDateTime(dr["ItemBuyDateMax"]); string dot = (i < dt.Rows.Count - 1 ? "," : ""); value += "{\"left\":\"" + (Convert.ToInt32(d1.ToString("MM")) - 1) + "\",\"right\":" + (GetRegionDate(d1, d2) - 1) + ",\"tip\":\"区间 " + d1.ToString("yyyy-MM-dd") + "~" + d2.ToString("yyyy-MM-dd") + "\"}" + dot; itemName = "\"" + dr["ItemName"].ToString() + "\"," + itemName; i++; } itemName = itemName.Remove(itemName.Length - 1); } else { itemName = "\"0\""; } Response.Write(GetChartJsonString(value, itemName)); Response.End(); }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); DateTime today = Convert.ToDateTime(Session["TodayDate"]); decimal priceMax = 0m; MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetBiJiaoFenXiList(userId, today, "chart", out priceMax); string max = "1"; string step = "1"; string catTypeName = ""; string itemPriceCur = ""; string itemPricePrev = ""; if (dt.Rows.Count > 0) { max = (priceMax > 0 ? Math.Floor(priceMax).ToString() : "1"); step = Math.Floor(Convert.ToDouble(max) / 10).ToString(); int i = 0; foreach (DataRow dr in dt.Rows) { string dot = (i < dt.Rows.Count - 1 ? "," : ""); catTypeName += "{\"text\":\"" + dr["CategoryTypeName"].ToString() + "\",\"rotate\":0}" + dot; itemPriceCur += dr["ZhiPriceCur"].ToString() + dot; itemPricePrev += dr["ZhiPricePrev"].ToString() + dot; i++; } } Response.Write(GetChartJsonString(catTypeName, itemPriceCur, itemPricePrev, max, step)); Response.End(); }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); int pageNumber = 1; int pagePerNumber = Convert.ToInt32(WebConfiguration.PagePerNumber); int howManyItems = 0; int notBuyMax = 0; MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetTianShuFenXiList(userId, pageNumber, pagePerNumber, out howManyItems, out notBuyMax); string max = "1"; string step = "1"; string itemName = ""; string notBuy = ""; if (dt.Rows.Count > 0) { max = notBuyMax.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 ? "," : ""); itemName += "{\"text\":\"" + dr["ItemName"].ToString() + "\",\"rotate\":90}" + dot; notBuy += dr["NotBuy"].ToString() + dot; i++; } } Response.Write(GetChartJsonString(itemName, notBuy, max, step)); Response.End(); }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); DateTime today = Convert.ToDateTime(Session["TodayDate"]); MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetFenLeiZongJiList(userId, today); string value = ""; if (dt.Rows.Count > 0 && Convert.ToDouble(dt.Rows[0]["ZhiPriceTotal"]) > 0) { foreach (DataRow dr in dt.Rows) { if (Convert.ToDouble(dr["ZhiPriceTotal"]) > 0) { value += "{\"value\":" + dr["ZhiPriceTotal"].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(); }
private void PopulateControls() { string title = Request.QueryString["title"]; int userId = Convert.ToInt32(Session["UserID"]); DateTime today = Utility.GetRequestDate(Request.QueryString["date"]); string catTypeId = "0"; if (Request.QueryString["catTypeId"] != null && Request.QueryString["catTypeId"] != "") { catTypeId = Request.QueryString["catTypeId"]; } string itemType = Request.QueryString["itemType"] ?? ""; string itemName = Request.QueryString["itemName"] ?? ""; MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetItemNumDetailList(userId, today, Convert.ToInt32(catTypeId), itemType, itemName, "chart"); decimal priceMax = 0m; string max = "1"; string step = "1"; string itemNameValue = ""; string itemPrice = ""; if (dt.Rows.Count > 0) { priceMax = Convert.ToDecimal(dt.Rows[0]["ItemPrice"]); max = Math.Ceiling(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 ? "," : ""); itemNameValue += "{\"text\":\"" + Convert.ToDateTime(dr["ItemBuyDate"]).ToString("yyyy-MM-dd") + "\",\"rotate\":90}" + dot; itemPrice += dr["ItemPrice"].ToString() + dot; i++; } } else { itemNameValue = "{\"text\":\"0\"},{\"text\":\"1\"}"; } Response.Write(GetChartJsonString(itemNameValue, itemPrice, title, max, step)); Response.End(); }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); DateTime today = Convert.ToDateTime(Session["TodayDate"]); if (curDate != "") { today = Convert.ToDateTime(curDate); } string orderBy = Request.QueryString["orderBy"] ?? "chart"; decimal priceMax = 0m; MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetItemDateTopList(userId, today, orderBy, out priceMax); string max = "1"; string step = "1"; string itemBuyDate = ""; string shouruPrice = ""; string zhichuPrice = ""; string tip = (orderBy == "list" ? "#x_label#" : today.ToString("yyyy-MM-") + "#x_label#"); if (dt.Rows.Count > 0) { max = Math.Ceiling(priceMax).ToString(); step = Math.Floor(Convert.ToDouble(max) / 10).ToString(); int i = 0; foreach (DataRow dr in dt.Rows) { string dot = (i < dt.Rows.Count - 1 ? "," : ""); string date = (orderBy == "list" ? Convert.ToDateTime(dr["ItemBuyDate"]).ToString("yyyy-MM-dd") : Convert.ToDateTime(dr["ItemBuyDate"]).ToString("dd")); int rotate = (orderBy == "list" ? 90 : 0); itemBuyDate += "{\"text\":\"" + date + "\",\"rotate\":" + rotate + "}" + dot; shouruPrice += dr["ShouRuPrice"].ToString() + dot; zhichuPrice += dr["ZhiChuPrice"].ToString() + dot; i++; } } else { itemBuyDate = "{\"text\":\"0\"},{\"text\":\"1\"}"; } Response.Write(GetChartJsonString(itemBuyDate, shouruPrice, zhichuPrice, max, step, tip)); Response.End(); }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); DateTime today = Convert.ToDateTime(Session["TodayDate"]); int catTypeId = Convert.ToInt32(Request.QueryString["catTypeId"]); decimal priceMax = 0m; int countMax = 0; MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetBiJiaoMingXiList(userId, today, catTypeId, 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(Convert.ToDouble(max) / 10).ToString(); max2 = countMax.ToString(); step2 = Math.Floor(Convert.ToDouble(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\":90}" + 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(); }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); DateTime today = DateTime.Now; if (Request.QueryString["term"] != null && Request.QueryString["term"] != "") { today = Convert.ToDateTime(Request.QueryString["term"]); } MonthBLL bll = new MonthBLL(); DataTable lists = bll.GetMonthListByItemBuyDate(userId, today); StringBuilder items = new StringBuilder(); if (lists.Rows.Count > 0) { items.Append("<table cellspacing=\"0\" border=\"1\" style=\"width:100%;\" class=\"tablelist\">"); foreach (DataRow dr in lists.Rows) { double ShouRuPrice = Convert.ToDouble(dr["ShouRuPrice"]); double ZhiChuPrice = Convert.ToDouble(dr["ZhiChuPrice"]); double JiePrice = Convert.ToDouble(dr["JiePrice"]); double HuanPrice = Convert.ToDouble(dr["HuanPrice"]); items.Append("<tr>"); items.Append("<td style=\"width:16%;\">" + dr["ItemName"].ToString() + "</td>"); items.Append("<td style=\"width:17%;\" class=\"cellprice\">" + (ShouRuPrice == 0 ? "" : "¥" + ShouRuPrice.ToString("0.0##")) + "</td>"); items.Append("<td style=\"width:17%;\" class=\"cellprice\">" + (ZhiChuPrice == 0 ? "" : "¥" + ZhiChuPrice.ToString("0.0##")) + "</td>"); items.Append("<td style=\"width:17%;\" class=\"cellprice\">" + (JiePrice == 0 ? "" : "¥" + JiePrice.ToString("0.##")) + "</td>"); items.Append("<td style=\"width:17%;\" class=\"cellprice\">" + (HuanPrice == 0 ? "" : "¥" + HuanPrice.ToString("0.##")) + "</td>"); items.Append("<td style=\"width:16%;\"><a href=\"ItemList.aspx?date=" + Convert.ToDateTime(dr["ItemBuyDate"]).ToString("yyyy-MM-dd") + "\">查看</a></td>"); items.Append("</tr>"); } items.Append("</table>"); } Response.Write(items.ToString()); Response.End(); }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); DateTime today = Convert.ToDateTime(Session["TodayDate"]); if (curDate != "") { today = Convert.ToDateTime(curDate); } MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetItemNumTopList(userId, today); int countMax = 0; string max = "1"; string step = "1"; string itemName = ""; string countNum = ""; if (dt.Rows.Count > 0) { countMax = Convert.ToInt32(dt.Rows[0]["CountNum"]); max = countMax.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 ? "," : ""); itemName += "{\"text\":\"" + dr["ItemName"].ToString() + "\",\"rotate\":90}" + dot; countNum += dr["CountNum"].ToString() + dot; i++; } } Response.Write(GetChartJsonString(itemName, countNum, max, step)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["page"] != "" && Request.QueryString["page"] != null) { int userId = Convert.ToInt32(Session["UserID"]); int pageNumber = Convert.ToInt32(Request.QueryString["page"]); int pagePerNumber = Convert.ToInt32(WebConfiguration.PagePerNumber); int howManyItems = 0; int notBuyMax = 0; StringBuilder items = new StringBuilder(); items.Append("["); MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetJianGeFenXiList(userId, pageNumber, pagePerNumber, out howManyItems, out notBuyMax); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { items.Append("{"); items.Append("\"RowNumber\":" + "\"" + dr["RowNumber"].ToString() + "\","); items.Append("\"ItemTypeName\":" + "\"" + dr["ItemTypeName"].ToString() + "\","); items.Append("\"ItemName\":" + "\"" + dr["ItemName"].ToString() + "\","); items.Append("\"ItemBuyDate\":" + "\"" + Convert.ToDateTime(dr["ItemBuyDate"].ToString()).ToString("yyyy-MM-dd") + "\","); items.Append("\"ItemBuyDateMax\":" + "\"" + Convert.ToDateTime(dr["ItemBuyDateMax"].ToString()).ToString("yyyy-MM-dd") + "\","); items.Append("\"NotBuy\":" + "\"" + dr["NotBuy"].ToString() + "\""); items.Append("},"); } items.Remove(items.ToString().LastIndexOf(','), 1); } items.Append("]"); Response.Write(items.ToString()); Response.End(); } }
private void PopulateControls() { int userId = Convert.ToInt32(Session["UserID"]); MonthBLL bll = new MonthBLL(); DataTable dt = bll.GetTuiJianFenXiList(userId); string max_x = "12"; string max_y = "2"; string value = ""; string label = ""; string data = ""; if (dt.Rows.Count > 0) { max_y = dt.Rows.Count.ToString(); data = "\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\""; int i = 0; foreach (DataRow dr in dt.Rows) { i++; value += (Convert.ToDateTime(dr["ItemBuyDate"]).ToString("MM") + ","); label += ("\"" + dr["ItemName"].ToString() + "\","); } value = value.Remove(value.Length - 1); label = label.Remove(label.Length - 1); } else { data = "\"空记录\""; } Response.Write(GetChartJsonString(value, label, data, max_x, max_y)); Response.End(); }
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(); }