UserOrder.aspx.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:2k
源码类别:
Email客户端
开发平台:
Visual C++
- 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;
- public partial class UserOrder : PageBase
- {
- classDB dd = new classDB();
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Session["Login"] == null)
- {
- Response.Redirect("Login.aspx");
- }
- else
- {
- String oid = Session["Login"].ToString();
- if (dd.IsCartNO(oid) == 0)
- {
- Response.Redirect("produce.aspx");
- Response.Write("<script>window.location.reload()</script>");
- }
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- classDB db = new classDB();
- String totalPrice = Session["totalPrice"].ToString();
- String totalNumber = Session["totalNumber"].ToString();
- String UID = Session["Login"].ToString();
- String name = TextBox2.Text.Trim();
- String postid = TextBox3.Text.Trim();
- String address = TextBox1.Text.Trim();
- String movePhone = TextBox4.Text.Trim();
- String homePhone = TextBox5.Text.Trim();
- String email = TextBox6.Text.Trim();
- if (db.InsertUser(UID, int.Parse(totalNumber), float.Parse(totalPrice)) != -1)
- {
- Response.Write("<script>alert('定单成功')</script>");
- }
- else
- {
- Response.Redirect("Default.aspx");
- }
- if (db.InsertOrderInformation(UID, name, postid, address, movePhone, homePhone, email) != -1)
- {
- Response.Write("<script>alert('用户信息成功')</script>");
- }
- else
- {
- Response.Redirect("Default.aspx");
- }
- if (db.CopypCart(UID) != -1)
- {
- ;
- }
- if (db.DeleteCart(UID) != -1)
- {
- Response.Redirect("suc.aspx");
- }
- }
- }