网上购物系统的设计与实现源代码_第1页
网上购物系统的设计与实现源代码_第2页
网上购物系统的设计与实现源代码_第3页
网上购物系统的设计与实现源代码_第4页
网上购物系统的设计与实现源代码_第5页
已阅读5页,还剩72页未读 继续免费阅读

下载本文档

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

文档简介

1、cm.aspx(页面) 地址 邮编 电话 真实姓名 cm.aspx.csusing System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.Web

2、Parts;using System.Xml.Linq;using System.Data.SqlClient;public partial class cm1 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) class insert protected void Button1_Click(object sender, EventArgs e) DataTable dtable; string sql = ConfigurationManager.ConnectionStringsCon.Co

3、nnectionString.ToString(); SqlConnection sqlb = new SqlConnection(sql); sqlb.Open(); string strt = select * from gouwuche where username= + Sessionname.ToString() + ; SqlDataAdapter sqlt = new SqlDataAdapter(strt, sqlb); DataSet ds = new DataSet(); DataRowCollection drow; sqlt.Fill(ds,tab); dtable =

4、 ds.Tablestab; drow = dtable.Rows; Random rnd = new Random(); long n = rnd.Next(10000, 99999); long m = rnd.Next(10000, 99999); long x = rnd.Next(10000, 99999); for (int i = 0; i drow.Count; i+) SqlCommand com = new SqlCommand(); com.Connection = sqlb; com.CommandText = insert into dingdan(id,sum,sp

5、rice,youbian,name,address,username,pho,sname,time,photo,sno)values(id,sum,sprice,youbian,name,address,username,pho,sname,time,photo,sno); com.Parameters.AddWithValue(id, n.ToString()+m.ToString()+x.ToString(); com.Parameters.AddWithValue(sum, drowi4.ToString(); com.Parameters.AddWithValue(sprice, dr

6、owi3.ToString(); com.Parameters.AddWithValue(youbian, TextBox2.Text.ToString(); com.Parameters.AddWithValue(name, TextBox4.Text.ToString(); com.Parameters.AddWithValue(address, TextBox1.Text.ToString(); com.Parameters.AddWithValue(username, Sessionname.ToString(); com.Parameters.AddWithValue(pho, Te

7、xtBox3.Text.ToString(); com.Parameters.AddWithValue(sname, drowi2.ToString(); com.Parameters.AddWithValue(time, System.DateTime.Now.ToString(); com.Parameters.AddWithValue(photo, drowi5.ToString(); com.Parameters.AddWithValue(sno, drowi0.ToString(); com.ExecuteNonQuery(); DataTable dtable2; string s

8、trt2 = select kucun from shangping where name= + drowi2.ToString() + ; SqlDataAdapter sqlf = new SqlDataAdapter(strt2, sqlb); DataSet ds2 = new DataSet(); DataRowCollection drow2; sqlf.Fill(ds, tab2); dtable2 = ds.Tablestab2; drow2 = dtable2.Rows; int a=Int32.Parse(drow200.ToString() - Int32.Parse(d

9、rowi4.ToString(); string strt3 = update shangping set kucun= + a.ToString() + where name= + drowi2.ToString() + ; SqlCommand upkc = new SqlCommand(strt3,sqlb); upkc.ExecuteNonQuery(); SqlCommand coms = new SqlCommand(); coms.Connection = sqlb; coms.CommandText = delete from gouwuche where username=n

10、ame; coms.Parameters.AddWithValue(name, Sessionname.ToString(); coms.ExecuteNonQuery(); sqlb.Close(); Response.Write(alert(恭喜你,订单已生成);); FenLeishop.aspx数码精品 a href=ShopMessage.aspx?no=target=blank img style=border:none; alt=商品 src=./image/Products/ 商品名: 价格: 服饰精品 a href=ShopMessage.aspx?no=target=bla

11、nk img style=border:none; alt=商品 src=./image/Products/ 商品名: 价格: 玩具精品 a href=ShopMessage.aspx?no=target=blank img style=border:none; alt=商品 src=./image/Products/ 商品名: 价格: 家居精品 a href=ShopMessage.aspx?no=target=blank img style=border:none; alt=商品 src=./image/Products/ 商品名: 价格: FenLeishop.aspx.csusing

12、System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class FenLe

13、ishop : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) listbind(); void listbind() string sql = ConfigurationManager.ConnectionStringscon.ConnectionString; DataSet ds = new DataSet(); using (SqlConnection sqlc = new SqlConnection(sql) SqlDataAdapter sqld = new SqlDataAdapter

14、(select * from shangping where style=数码精品 , sqlc); SqlDataAdapter sqle = new SqlDataAdapter(select * from shangping where style=服饰精品 , sqlc); SqlDataAdapter sqlf = new SqlDataAdapter(select * from shangping where style=玩具精品 , sqlc); SqlDataAdapter sqla = new SqlDataAdapter(select * from shangping wh

15、ere style=家居精品 , sqlc); sqld.Fill(ds, tbsp); sqle.Fill(ds, tbsp1); sqlf.Fill(ds, tbsp2); sqla.Fill(ds, tbsp3); DataList1.DataSource = ds.Tablestbsp.DefaultView; DataList1.DataBind(); DataList2.DataSource = ds.Tablestbsp1.DefaultView; DataList2.DataBind(); DataList3.DataSource = ds.Tablestbsp2.Defaul

16、tView; DataList3.DataBind(); DataList4.DataSource = ds.Tablestbsp3.DefaultView; DataList4.DataBind(); Hotshop.aspx a href=ShopMessage.aspx?no=target=blank img style=border:none; alt=商品 src=./image/Products/ 商品名: 价格: Hotshop.aspx.csusing System;using System.Data;using System.Configuration;using Syste

17、m.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class Hotshop : System.Web.UI.Page protected void Page_Load(object sender,

18、 EventArgs e) listbind(); void listbind() string sql = ConfigurationManager.ConnectionStringscon.ConnectionString; DataSet ds = new DataSet(); using (SqlConnection sqlc = new SqlConnection(sql) SqlDataAdapter sqld = new SqlDataAdapter(select top 20* from shangping , sqlc); sqld.Fill(ds, tbsp); DataList1.DataSource = ds.Tablestbsp.DefaultView; DataList1.DataBind(); index.aspx body #screen span position:absolute;overflow:hidden;border:#FFF sol

温馨提示

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

评论

0/150

提交评论