付款.aspx.cs
上传用户:vtryaojia
上传日期:2020-04-18
资源大小:1214k
文件大小:3k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.OleDb;
  12. public partial class mainboard_mainboard : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         TextBox6.Text = Convert.ToString(Session["name"]);
  17.         TextBox1.Text = Convert.ToString(Session["sum"]);
  18.         TextBox3.Text = Convert.ToString(15 + Convert.ToInt32(Session["sum"]));
  19.         TextBox7.Text = Convert.ToString(Session["prodectname"]);
  20.         string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
  21.         OleDbConnection conn = new OleDbConnection(strConnection);
  22.         conn.Open();
  23.         OleDbCommand cmd1 = new OleDbCommand("select * from [Member] where name='" + Session["name"] + "'");
  24.         cmd1.Connection = conn;
  25.         OleDbDataReader dr = cmd1.ExecuteReader();
  26.         if (dr.Read())
  27.         {
  28.             TextBox6.Text = dr["name"].ToString();
  29.             TextBox4.Text = dr["PhoneCode"].ToString();
  30.             TextBox5.Text = dr["Address"].ToString();
  31.         }
  32.     }
  33.     protected void Button1_Click(object sender, EventArgs e)
  34.     {
  35.         string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
  36.         OleDbConnection conn = new OleDbConnection(strConnection);
  37.         conn.Open();
  38.         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);
  39.         cmd1.ExecuteNonQuery();
  40.         conn.Close();
  41.         string strConnection2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
  42.         OleDbConnection conn2 = new OleDbConnection(strConnection2);
  43.         conn2.Open();
  44.         OleDbCommand cmd2 = new OleDbCommand("delete from SpKd", conn2);
  45.         cmd2.ExecuteNonQuery();
  46.         conn2.Close();
  47.         Session["GWC_ID"] = 1;
  48.         Session["prodectname"] = "";
  49.         Response.Redirect("购买成功.aspx");
  50.     }
  51.     
  52. }