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.SqlClient;
public partial class WebMain_Product_cart_jycart : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["PN"]!= null)
        {
            if (!IsPostBack)
            {
                this.pname.Text = Request.QueryString["PN"].ToString();
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        this.Label2.Visible = true;
        SqlConnection conn = CDatabase.wtoconn();
        conn.Open();
        string sql = "insert into Jyorder(pname,pcount,username,Cname,tel,Email,address,post,mono,ck,addtime,lan) values ('" + this.pname.Text + "','" + this.pcount.Text + "','" + this.username.Text + "','" + this.Cname.Text + "','" + this.tel.Text + "','" + this.Email.Text + "','" + this.address.Text + "','" + this.post.Text + "','" + this.mono.Text + "','未查看','"+DateTime.Now.ToString()+"','china')";
        if (Doadmin.Exec(sql))
        {
            this.Label2.Text = "操作成功";
        }
        else
        {
            //Response.Write(sql);
            this.Label2.Text = "操作失败";
            //Response.Write("<script>alert('操作失败');window.location.href='#'</script>");
        }
        conn.Close();
    }
}
