您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->我的小书坊源码(三层实现)>>BookStatistics.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:我的小书坊源码(三层实现)
当前文件:文件类型 MyBookShop/BookStatistics.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Collections; 3using System.ComponentModel; 4using System.Data; 5using System.Drawing; 6using System.Web; 7using System.Web.SessionState; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.HtmlControls; 11 12using MyBookShop.BusinessLogicLayer; 13 14namespace MyBookShop.Web 15{ 16 /// <summary> 17 /// BookStatistics 的摘要说明。 18 /// </summary> 19 public partial class BookStatistics : System.Web.UI.Page 20 { 21 22 protected void Page_Load(object sender, System.EventArgs e) 23 { 24 if(!IsPostBack) 25 DrawChartByCategory(); 26 } 27 28 /// <summary> 29 /// 按照图书类别统计 30 /// </summary> 31 private void DrawChartByCategory() 32 { 33 DataTable dt=Book.GetSaleCountByCategory(); 34 string title="图书销售量统计"; //标题 35 string subTitle="基于图书种类"; //副标题 36 string targetFile = Server.MapPath(".\\Images\\") + "Category.gif"; //图象文件 37 Chart.DrawPie(title,subTitle,300,300,dt,targetFile,"CategoryName","SaleCount"); 38 39 Image.ImageUrl=targetFile; 40 } 41 /// <summary> 42 /// 按照出版社统计 43 /// </summary> 44 //该源码下载自www.51aspx.com(51-aspx.com) 45 private void DrawChartByPublisher() 46 { 47 DataTable dt=Book.GetSaleCountByPublisher(); 48 string title="图书销售量统计"; //标题 49 string subTitle="基于出版社"; //副标题 50 string targetFile = Server.MapPath(".") + "\\Images\\Publiser.gif"; //图象文件 51 52 Chart.DrawPie(title,subTitle,300,300,dt,targetFile,"Publisher","SaleCount"); 53 54 Image.ImageUrl=targetFile; 55 } 56 /// <summary> 57 /// 按照价格类别统计 58 /// </summary> 59 private void DrawChartByPrice() 60 { 61 DataTable dt=Book.GetSaleCountByPrice(); 62 string title="图书销售量统计"; //标题 63 string subTitle="基于图书价格"; //副标题 64 65 string targetFile = HttpContext.Current.Server.MapPath(".\\Images\\") + "Price.gif"; //图象文件 66 Chart.DrawPie(title,subTitle,300,300,dt,targetFile,"PriceGrade","SaleCount"); 67 68 Image.ImageUrl=targetFile; 69 } 70 /// <summary> 71 /// 下拉框选择事件 72 /// </summary> 73 /// <param name="sender"></param> 74 /// <param name="e"></param> 75 protected void DropDownListType_SelectedIndexChanged(object sender, System.EventArgs e) 76 { 77 switch(DropDownListType.SelectedValue) 78 { 79 case "图书类别": 80 DrawChartByCategory(); 81 break; 82 case "出版社": 83 DrawChartByPublisher(); 84 break; 85 case "价格": 86 DrawChartByPrice(); 87 break; 88 89 } 90 } 91 } 92} 93
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:我的小书坊源码(三层实现)
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号