您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->在线订票系统源码(毕业设计)>>MonthStatistics.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:在线订票系统源码(毕业设计)


当前文件路径:TicketOnline/MonthStatistics.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using System.Data.SqlClient; 12 13public partial class MonthStatistics : System.Web.UI.Page 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 if (!IsPostBack) 18 { 19 20 } 21 } 22 private void YudingMoney() 23 { 24 //所有预定车票当月的收入 25 int month = this.DropDownList1.SelectedIndex + 1; 26 SqlConnection con = db.ceratcon(); 27 con.Open(); 28 SqlCommand cmd = new SqlCommand("select sum(Omoney) from OrderTicket where month(ObuyTime)='" + month + "'", con); 29 decimal summoney = Convert.ToDecimal(cmd.ExecuteScalar()); 30 this.Label1.Text = Convert.ToString(summoney); 31 32 con.Close(); 33 34 35 } 36 private void Money() 37 { 38 //所有出售车票当月的收入 39 int month = this.DropDownList1.SelectedIndex + 1; 40 SqlConnection con = db.ceratcon(); 41 con.Open(); 42 SqlCommand cmd = new SqlCommand("select sum(Smoney) from SealTicket where month(Stime)='"+month+"'", con); 43 decimal summoney = Convert.ToDecimal(cmd.ExecuteScalar()); 44 this.Label2.Text = Convert.ToString(summoney); 45 46 47 } 48 49 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 50 { 51 Checkidmonth1(); 52 Checkidmonth2(); 53 54 55 //计算总营业额 56 if (Label1.Text != "" || Label2.Text != "") 57 { 58 decimal str1 = Convert.ToDecimal(this.Label1.Text); 59 decimal str2 = Convert.ToDecimal(this.Label2.Text); 60 this.Label3.Text = Convert.ToString(str2 + str1); 61 } 62 } 63 private void Checkidmonth1() 64 { 65 //检索出售的车票表中是否存在所选择月份信息 66 int month = this.DropDownList1.SelectedIndex + 1; 67 SqlConnection con = db.ceratcon(); 68 con.Open(); 69 SqlCommand cmd = new SqlCommand("select * from SealTicket where month(Stime)='" + month + "'", con); 70 SqlDataReader sdr = cmd.ExecuteReader(); 71 if (sdr.Read()) 72 { 73 Money(); 74 } 75 76 else 77 { 78 79 Response.Write("<script language='javascript'>alert('该月份没有数据');location.href='MonthStatistics.aspx'</script>"); 80 } 81 82 } 83 84 private void Checkidmonth2() 85 { 86 int month = this.DropDownList1.SelectedIndex + 1; 87 //检索预售的车票表中是否存在所选择月份信息 88 89 SqlConnection con = db.ceratcon(); 90 con.Open(); 91 SqlCommand cmd = new SqlCommand("select * from OrderTicket where month(ObuyTime)='" + month + "'", con); 92 SqlDataReader sdr = cmd.ExecuteReader(); 93 if (sdr.Read()) 94 { 95 YudingMoney(); 96 } 97 98 else 99 { 100 101 Response.Write("<script language='javascript'>alert('该月份没有数据');location.href='MonthStatistics.aspx'</script>"); 102 } 103 104 } 105} 106
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:在线订票系统源码(毕业设计)

- X2BlogV5.0正式版源码(Asp.n..

- 高校教师档案管理系统项目源码

- 内文广告管理系统V1.1版源码

- 柠檬居IT技术网多用户Blog源码

- ajax奥运留言本v1.0源码

- WebChart生成漂亮饼图源码

- 51aspx员工绩效考核系统

- NetCms1.0(Buid080411)免安装..

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号