订单信息模块前后台代码.doc_第1页
订单信息模块前后台代码.doc_第2页
订单信息模块前后台代码.doc_第3页
订单信息模块前后台代码.doc_第4页
订单信息模块前后台代码.doc_第5页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

禧徕乐快递管理系统-订单信息管理模块前后台代码XI LAI LE Express Management SystemModule of Order Information ManagementCodeCR项目组V1.0 拟 制 人 叶 霆 Writer Ting Ye 学 号 3112101102 Number 2102-011-0276 二一四年六月十二日June 12, 2014目 录1.订单管理后台代码11.1 Express.asp 订单录入模块11.2 ExpressList.asp 订单领取查询模块31.3 ddHjbl.asp 订单痕迹保留模块32 订单管理后台代码72.1 Express.asp 录入前台代码72.2 ExpressList.asp 领取查询前台代码152.3 Ddhjbl.asp 痕迹保留前台代码191.订单管理后台代码1.1 Express.asp 订单录入模块using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Net;public partial class Express : AdminPage Adinet_ExpressListService ass = new Adinet_ExpressListService(); protected void Page_Load(object sender, EventArgs e) SqlConnection scn = new SqlConnection(Data Source=(local);Initial Catalog=EXPRESS;Integrated Security=True); /连接数据库 scn.Open(); IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName(); /获取IP地址 string myip = IpEntry.AddressList5.ToString(); /获取IP地址 System.DateTime time = new System.DateTime(); /获取服务器系统时间 time = System.DateTime.Now; string czlx = 录入操作; string czxx = rename.Value + retel.Value + sendName.Value + sendAdd.Value + sendTel.Value + sendDate.Value; /输入信息记录 String ocmd1 = insert into hjbl(czip,czsj,czlx,czxx) values( + myip + , + time + , + czlx + , + czxx + ); /存储至数据库 SqlCommand com = new SqlCommand(ocmd1, scn); com.ExecuteNonQuery(); scn.Close(); if (!IsPostBack) int n = 65; /定义n System.Random random = new Random(); /定义随机数 num.Value = Convert.ToChar(n) + DateTime.Now.ToString(yyyymmddhhmmss) + random.Next(100).ToString(); /将字母+系统时间+随机数附加给订单 if (!IsNull(id) Adinet_ExpressList aa = ass.GetById(int.Parse(Requestid); num.Value = aa.Num; thingname.Value = aa.ThingsName; rename.Value = aa.ReceiveName; retel.Value = aa.ReceiveTel; sendName.Value = aa.SendBy; sendAdd.Value = aa.SendAddress; sendTel.Value = aa.SendTel; sendDate.Value = aa.SendDate; expressName.Value = aa.ExpressName; redate.Value = aa.ArrivalDate; getdate.Value = aa.GetDate; getname.Value = aa.GetName; public void submitbtn_ServerClick(object sender, EventArgs e) if (!IsNull(id) Adinet_ExpressList aa = ass.GetById(int.Parse(Requestid);/定义和赋值 aa.Num = num.Value; aa.ThingsName = thingname.Value; aa.ReceiveName = rename.Value; aa.ReceiveTel = retel.Value; aa.SendBy = sendName.Value; aa.SendAddress = sendAdd.Value; aa.SendTel = sendTel.Value; aa.SendDate = sendDate.Value; aa.ExpressName = expressName.Value; aa.ArrivalDate = redate.Value; aa.GetDate = getdate.Value; aa.GetName = getname.Value; ass.Edit(aa); else Adinet_ExpressList aa = new Adinet_ExpressList(); aa.Num = num.Value; aa.ThingsName = thingname.Value; aa.ReceiveName = rename.Value; aa.ReceiveTel = retel.Value; aa.SendBy = sendName.Value; aa.SendAddress = sendAdd.Value; aa.SendTel = sendTel.Value; aa.SendDate = sendDate.Value; aa.ExpressName = expressName.Value; aa.ArrivalDate = redate.Value; aa.GetDate = getdate.Value; aa.GetName = getname.Value; ass.Add(aa); Alert(操作成功!, ExpressList.aspx);/页面跳转 protected void Button1_Click1(object sender, EventArgs e) System.Random random = new Random(); /定义随机数 string s = num.Value.Substring(0, 1); /定义 int n = Convert.ToInt32(s0); /转换为字母 num.Value = Convert.ToChar(n + 1) + DateTime.Now.ToString(yyyymmddhhmmss) + random.Next(100).ToString(); 1.2 ExpressList.asp 订单领取查询模块using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class ExpressList : AdminPage Adinet_ExpressListService ass = new Adinet_ExpressListService(); protected void Page_Load(object sender, EventArgs e) if (!IsNull(del) ass.Delete(int.Parse(Requestdel); Alert(删除成功|!, ExpressList.aspx); 1.3 ddHjbl.asp 订单痕迹保留模块using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.IO;using System.Data.SqlClient;using System.Data;public partial class Default2 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) Export(application/ms-excel, 痕迹保留.xls); /导出为EXECL private void Export(string FileType, string FileName) Response.Charset = GB2312; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.AppendHeader(Content-Disposition, attachment;filename= + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8 ).ToString(); Response.ContentType = FileType; this.EnableViewState = false; StringWriter tw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(tw); GridView1.RenderControl(hw); Response.Write(tw.ToString(); Response.End(); public override void VerifyRenderingInServerForm(Control control) protected void Button2_Click(object sender, EventArgs e) string a = ; string c = select * from hjbl where ; GridView1.DataSourceID = ; SqlConnection scn = new SqlConnection(Data Source=(local);Initial Catalog=EXPRESS;Integrated Security=True); /连接数据库 scn.Open(); if (RadioButton1.Checked = true) if (TextBox1.Text != ) a = a + czlx= + TextBox1.Text + and ; if (TextBox2.Text != ) a = a + czxx= + TextBox2.Text + ; else if (TextBox3.Text != ) a = a + czip= + TextBox3.Text + ; else a = a + czxx= + TextBox1.Text + and ; a = a = a + czip= + TextBox3.Text + ; else if (RadioButton2.Checked = true) if (TextBox1.Text != ) a = a + czlx= + TextBox1.Text + or ; if (TextBox2.Text != ) a = a + czxx= + TextBox2.Text + ; else if (TextBox3.Text != ) a = a + czip= + TextBox3.Text + ; else a = a + czxx= + TextBox1.Text + or ; a = a = a + czip= + TextBox3.Text + ; if (RadioButton3.Checked = true) if (TextBox1.Text != ) a = a + czlx= + TextBox1.Text + and ; if (TextBox2.Text != ) a = a + czxx + TextBox2.Text + ; else if (TextBox3.Text != ) a = a + czip + TextBox3.Text + ; else a = a + czxx= + TextBox1.Text + and ; a = a = a + czip + TextBox3.Text + ; string b = c + + a; string num = b; SqlCommand com = new SqlCommand(num, scn); SqlDataAdapter da = new SqlDataAdapter(); DataSet ds = new DataSet(); da.SelectCommand = com; da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); com.ExecuteNonQuery(); scn.Close(); protected void Button3_Click(object sender, EventArgs e) SqlConnection scn = new SqlConnection(Data Source=(local);Initial Catalog=EXPRESS;Integrated Security=True); scn.Open(); if (TextBox5.Text = ) SqlDataAdapter adapter = new SqlDataAdapter(select * from hjbl where czsj

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论