付款.aspx.cs
资源名称:WebSite1.rar [点击查看]
上传用户:vtryaojia
上传日期:2020-04-18
资源大小:1214k
文件大小:3k
源码类别:
SCSI/ASPI
开发平台:
Others
- using 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.OleDb;
- public partial class mainboard_mainboard : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- TextBox6.Text = Convert.ToString(Session["name"]);
- TextBox1.Text = Convert.ToString(Session["sum"]);
- TextBox3.Text = Convert.ToString(15 + Convert.ToInt32(Session["sum"]));
- TextBox7.Text = Convert.ToString(Session["prodectname"]);
- string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
- OleDbConnection conn = new OleDbConnection(strConnection);
- conn.Open();
- OleDbCommand cmd1 = new OleDbCommand("select * from [Member] where name='" + Session["name"] + "'");
- cmd1.Connection = conn;
- OleDbDataReader dr = cmd1.ExecuteReader();
- if (dr.Read())
- {
- TextBox6.Text = dr["name"].ToString();
- TextBox4.Text = dr["PhoneCode"].ToString();
- TextBox5.Text = dr["Address"].ToString();
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
- OleDbConnection conn = new OleDbConnection(strConnection);
- conn.Open();
- OleDbCommand cmd1 = new OleDbCommand("insert into OrderInfo (OrderDate,GoodsFee,ShipFee,TotalPrice,ReceiverName,PhoneNub,ShipType,PayType,ReceiverAddress,ReceiverPostCode,bz) values('" + Convert.ToString(DateTime.Today) + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox6.Text + "','" + TextBox4.Text + "','" + DropDownList2.SelectedValue + "','" + DropDownList1.SelectedValue + "','" + TextBox5.Text + "','" + TextBox8.Text + "','" + TextBox7.Text + "')", conn);
- cmd1.ExecuteNonQuery();
- conn.Close();
- string strConnection2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
- OleDbConnection conn2 = new OleDbConnection(strConnection2);
- conn2.Open();
- OleDbCommand cmd2 = new OleDbCommand("delete from SpKd", conn2);
- cmd2.ExecuteNonQuery();
- conn2.Close();
- Session["GWC_ID"] = 1;
- Session["prodectname"] = "";
- Response.Redirect("购买成功.aspx");
- }
- }