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


当前文件路径:TicketOnline/QuarterStatistics.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 QuarterStatistics : System.Web.UI.Page 14{ 15 public string str; 16 protected void Page_Load(object sender, EventArgs e) 17 { 18 19 } 20 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 21 { 22 Checkidmonth1(); 23 Checkidmonth2(); 24 if (Label1.Text != "" || Label2.Text != "") 25 { 26 decimal str1 = Convert.ToDecimal(this.Label1.Text); 27 decimal str2 = Convert.ToDecimal(this.Label2.Text); 28 this.Label3.Text = Convert.ToString(str2 + str1); 29 } 30 31 } 32 private void YudingMoney() 33 { 34 if (DropDownList1.SelectedItem.Text == "第一季度") 35 { 36 str = "select sum(Omoney) from OrderTicket where ObuyTime between '2007-01-01' and '2007-03-31'"; 37 38 39 40 } 41 else if (DropDownList1.SelectedItem.Text == "第二季度") 42 { 43 str = "select sum(Omoney) from OrderTicket where ObuyTime between '2007-04-01 'and '2007-06-30'"; 44 } 45 else if (DropDownList1.SelectedItem.Text == "第三季度") 46 { 47 str = "select sum(Omoney) from OrderTicket where ObuyTime between '2007-07-01' and '2007-09-30'"; 48 } 49 else if (DropDownList1.SelectedItem.Text == "第四季度") 50 { 51 str = "select sum(Omoney) from OrderTicket where ObuyTime between '2007-10-01' and '2007-12-31'"; 52 53 } 54 //所有预定车票季度的收入 55 int month = this.DropDownList1.SelectedIndex + 1; 56 SqlConnection con = db.ceratcon(); 57 con.Open(); 58 SqlCommand cmd = new SqlCommand(str,con); 59 cmd.CommandText = str; 60 decimal summoney = Convert.ToDecimal(cmd.ExecuteScalar()); 61 this.Label1.Text = Convert.ToString(summoney); 62 63 con.Close(); 64 65 66 } 67 private void Money() 68 { 69 if (DropDownList1.SelectedItem.Text == "第一季度") 70 { 71 str = "select sum(Smoney) from SealTicket where Stime between '2007-01-01' and '2007-03-31'"; 72 73 74 75 } 76 else if (DropDownList1.SelectedItem.Text == "第二季度") 77 { 78 str = "select sum(Smoney) from SealTicket where Stime between '2007-04-01 'and '2007-06-30'"; 79 } 80 else if (DropDownList1.SelectedItem.Text == "第三季度") 81 { 82 str = "select sum(Smoney) from SealTicket where Stime between '2007-07-01' and '2007-09-30'"; 83 } 84 else if (DropDownList1.SelectedItem.Text == "第四季度") 85 { 86 str = "select sum(Smoney) from SealTicket where Stime between '2007-10-01' and '2007-12-31'"; 87 88 } 89 //所有出售车票季度的收入 90 91 SqlConnection con = db.ceratcon(); 92 con.Open(); 93 SqlCommand cmd = new SqlCommand(); 94 cmd.Connection = (SqlConnection)con; 95 cmd.CommandText = str; 96 decimal summoney = Convert.ToDecimal(cmd.ExecuteScalar()); 97 this.Label2.Text = Convert.ToString(summoney); 98 99 100 101 102 } 103 104 private void Checkidmonth1() 105 { 106 //检索出售的车票表中是否存在所选择月份信息 107 if (DropDownList1.SelectedItem.Text == "第一季度") 108 { 109 str = "select Stime from SealTicket where Stime between '2007-01-01' and '2007-03-31'"; 110 111 112 113 } 114 else if (DropDownList1.SelectedItem.Text == "第二季度") 115 { 116 str = "select Stime from SealTicket where Stime between '2007-04-01 'and '2007-06-30'"; 117 } 118 else if (DropDownList1.SelectedItem.Text == "第三季度") 119 { 120 str = "select Stime from SealTicket where Stime between '2007-07-01' and '2007-09-30'"; 121 } 122 else if (DropDownList1.SelectedItem.Text == "第四季度") 123 { 124 str = "select Stime from SealTicket where Stime between '2007-10-01' and '2007-12-31'"; 125 126 } 127 SqlConnection con = db.ceratcon(); 128 con.Open(); 129 SqlCommand cmd = new SqlCommand(); 130 cmd.Connection = (SqlConnection)con; 131 cmd.CommandText = str; 132 SqlDataReader sdr = cmd.ExecuteReader(); 133 if (sdr.Read()) 134 { 135 Money(); 136 } 137 138 else 139 { 140 141 Response.Write("<script language='javascript'>alert('该季度没有数据');location.href='QuarterStatistics.aspx'</script>"); 142 } 143 144 } 145 146 private void Checkidmonth2() 147 { 148 149 //检索预售的车票表中是否存在所选择季度的信息 150 if (DropDownList1.SelectedItem.Text == "第一季度") 151 { 152 str = "select ObuyTime from OrderTicket where ObuyTime between '2007-01-01' and '2007-03-31'"; 153 154 155 156 } 157 else if (DropDownList1.SelectedItem.Text == "第二季度") 158 { 159 str = "select ObuyTime from OrderTicket where ObuyTime between '2007-04-01 'and '2007-06-30'"; 160 } 161 else if (DropDownList1.SelectedItem.Text == "第三季度") 162 { 163 str = "select ObuyTime from OrderTicket where ObuyTime between '2007-07-01' and '2007-09-30'"; 164 } 165 else if (DropDownList1.SelectedItem.Text == "第四季度") 166 { 167 str = "select ObuyTime from OrderTicket where ObuyTime between '2007-10-01' and '2007-12-31'"; 168 169 } 170 SqlConnection con = db.ceratcon(); 171 con.Open(); 172 SqlCommand cmd = new SqlCommand(); 173 cmd.Connection = (SqlConnection)con; 174 cmd.CommandText = str; 175 SqlDataReader sdr = cmd.ExecuteReader(); 176 if (sdr.Read()) 177 { 178 YudingMoney(); 179 } 180 181 else 182 { 183 184 Response.Write("<script language='javascript'>alert('该季度没有数据');location.href='QuarterStatistics.aspx'</script>"); 185 } 186 187 } 188 189} 190
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:在线订票系统源码(毕业设计)

- Asp.net2.0电子商务网源码

- 信管家园整站系统源码

- Asp.net魔兽世界代练网站系统..

- X2Blog4.0及X2WebControls源码

- XStuMan学生管理系统源码及论文

- 科信客户关系管理系统源码

- Asp.net随机生成图像签名源代..

- 替某公司写的一个小论坛(供..

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