Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Model.order      orderPay;
        BLL.BLLshoplist2 blll = new BLL.BLLshoplist2();
        int result            = 0;

        //支付未支付的订单逻辑
        if (Request.QueryString["flag"] == "1")
        {
            orderPay          = (Model.order)Session["orderTable"];
            ordernum.Text     = orderPay.ordernum;
            wprice.Text       = orderPay.sumprice.ToString();
            waysgive.Text     = orderPay.waysgive;
            orderPay.paystate = 1;
            result            = blll.updatePaystateById(orderPay);
        }
        else
        {
            ordernum.Text     = Session["ordernum"].ToString();
            wprice.Text       = Session["wholeprice"].ToString();
            waysgive.Text     = Session["waysgive"].ToString();
            Session["dt"]     = null;
            orderPay          = (Model.order)Session["orderUser"];
            orderPay.paystate = 1;
            result            = blll.updateOrdertable(orderPay);
        }
    }
Ejemplo n.º 2
0
 public void bindaddress()
 {
     Model.address myaddress = new Model.address();
     myaddress.userid  = Convert.ToInt32(Session["_userid"]);
     BLL.BLLshoplist2 blll = new BLL.BLLshoplist2();
     MySqlDataReader dr = blll.readaddress(myaddress);
        if (dr.Read())
        {
        address.Text = dr["_address"].ToString();
        tel.Text = dr["_tel"].ToString();
        mobile.Text = dr["_mobile"].ToString();
        receivename.Text = dr["_name"].ToString();
        mail.Text = dr["_mail"].ToString();
        }
        dr.Close();
        Label1.Text = receivename.Text+" ";
        Label2.Text =  address.Text + " ";
        Label3.Text = mobile.Text + " ";
        Label4.Text =  tel.Text + " ";
        Label5.Text = mail.Text + " ";
 }
Ejemplo n.º 3
0
    public void bindaddress()
    {
        Model.address myaddress = new Model.address();
        myaddress.userid = Convert.ToInt32(Session["_userid"]);
        BLL.BLLshoplist2 blll = new BLL.BLLshoplist2();
        SqlDataReader    dr   = blll.readaddress(myaddress);

        if (dr.Read())
        {
            address.Text     = dr["_address"].ToString();
            tel.Text         = dr["_tel"].ToString();
            mobile.Text      = dr["_mobile"].ToString();
            receivename.Text = dr["_name"].ToString();
            mail.Text        = dr["_mail"].ToString();
        }
        dr.Close();
        Label1.Text = receivename.Text + " ";
        Label2.Text = address.Text + " ";
        Label3.Text = mobile.Text + " ";
        Label4.Text = tel.Text + " ";
        Label5.Text = mail.Text + " ";
    }
Ejemplo n.º 4
0
    public void bindordertable()
    {
        //ordertable数据的插入
        Model.order myorder = new Model.order();
        myorder.ordernum    = DateTime.Now.ToString("yyyyMMddhhmmssfff");
        Session["ordernum"] = myorder.ordernum;
        myorder.userid      = Convert.ToInt32(Session["_userid"]);
        myorder.buyremarks  = Server.HtmlEncode(buyremarks.Text);
        myorder.count       = Convert.ToInt32(wholeprocount.Text);
        myorder.address     = Server.HtmlEncode(address.Text);
        myorder.tel         = Server.HtmlEncode(tel.Text);
        myorder.mobile      = Server.HtmlEncode(mobile.Text);
        myorder.mail        = Server.HtmlEncode(mail.Text);
        myorder.name        = Server.HtmlEncode(receivename.Text);
        myorder.sumprice    = Convert.ToDouble(wprice.Text);
        //if (needbill.Checked)
        //{
        //    myorder.needbill = 1;
        //}
        //else
        //{
        //    myorder.needbill = 0;
        //}
        if (online.Checked)
        {
            myorder.waysgive = "在线支付";
        }
        else
        {
            myorder.waysgive = "货到付款";
        }
        Session["waysgive"]  = myorder.waysgive;
        Session["orderUser"] = myorder;
        BLL.BLLshoplist2 blll = new BLL.BLLshoplist2();
        int result            = blll.insertOrdertable(myorder);
        //ordertabldetail数据的插入
        int result2 = 0;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            Model.orderdetail myorderdetail = new Model.orderdetail();

            Label sumweight  = new Label();
            Label sumprice   = new Label();
            Label weight     = new Label();
            Label count      = new Label();
            Label localprice = new Label();
            Label title      = new Label();
            Label cate       = new Label();
            Label id         = new Label();
            Image img        = new Image();
            sumweight               = (Label)GridView1.Rows[i].FindControl("sumweight");
            sumprice                = (Label)GridView1.Rows[i].FindControl("sumprice");
            weight                  = (Label)GridView1.Rows[i].FindControl("weight");
            count                   = (Label)GridView1.Rows[i].FindControl("count");
            localprice              = (Label)GridView1.Rows[i].FindControl("localprice");
            title                   = (Label)GridView1.Rows[i].FindControl("title");
            img                     = (Image)GridView1.Rows[i].FindControl("img");
            cate                    = (Label)GridView1.Rows[i].FindControl("cate");
            id                      = (Label)GridView1.Rows[i].FindControl("id");
            myorderdetail.ordernum  = Session["ordernum"].ToString();
            myorderdetail.sumweight = sumweight.Text;
            myorderdetail.sumprice  = Convert.ToDouble(sumprice.Text);
            myorderdetail.weight    = weight.Text;
            myorderdetail.count     = Convert.ToInt32(count.Text);
            myorderdetail.price     = Convert.ToDouble(localprice.Text);
            myorderdetail.title     = title.Text;
            myorderdetail.proimage  = img.ImageUrl;
            myorderdetail.cate      = cate.Text;
            myorderdetail.proid     = Convert.ToInt32(id.Text);
            result2                 = blll.insertdetail(myorderdetail);
        }
        if (result > 0 && result2 > 0)
        {
            Response.Redirect("shoplist3.aspx");
        }
        else
        {
            Common.MessageAlert.Alert(Page, "提交失败!");
        }
    }
Ejemplo n.º 5
0
    public void bindordertable()
    {
        //ordertable数据的插入
        Model.order myorder = new Model.order();
        myorder.ordernum = DateTime.Now.ToString("yyyyMMddhhmmssfff");
        Session["ordernum"] = myorder.ordernum;
        myorder.userid = Convert.ToInt32(Session["_userid"]);
        myorder.buyremarks =Server .HtmlEncode ( buyremarks.Text);
        myorder.count = Convert.ToInt32(wholeprocount.Text);
        myorder.address =Server .HtmlEncode ( address.Text);
        myorder.tel =Server .HtmlEncode ( tel.Text);
        myorder.mobile =Server .HtmlEncode ( mobile.Text);
        myorder.mail =Server .HtmlEncode ( mail.Text);
        myorder.name =Server .HtmlEncode ( receivename.Text);
        myorder.sumprice = Convert.ToDouble(wprice.Text);
        if (needbill.Checked)
        {
            myorder.needbill = 1;
        }
        else
        {
            myorder.needbill = 0;
        }
        if (online.Checked)
        {
            myorder.waysgive = "在线支付";
        }
        else
        {
            myorder.waysgive = "货到付款";
        }
        Session["waysgive"] = myorder.waysgive;
        BLL.BLLshoplist2 blll = new BLL.BLLshoplist2();
        int result = blll.insert(myorder);
        //ordertabldetail数据的插入
        int result2=0;
        for(int i=0;i<GridView1 .Rows .Count ;i++)
        {
        Model .orderdetail myorderdetail=new Model.orderdetail ();

        Label sumweight = new Label();
        Label sumprice = new Label();
        Label weight = new Label();
        Label count = new Label();
        Label localprice = new Label();
        Label title = new Label();
        Label size = new Label();
        Label color = new Label();
        Label cate = new Label();
        Label id=new Label();
        Image img = new Image();
        sumweight = (Label)GridView1.Rows[i].FindControl("sumweight");
        sumprice = (Label)GridView1.Rows[i].FindControl("sumprice");
        weight = (Label)GridView1.Rows[i].FindControl("weight");
        count = (Label)GridView1.Rows[i].FindControl("count");
           localprice = (Label)GridView1.Rows[i].FindControl("localprice");
        title = (Label)GridView1.Rows[i].FindControl("title");
        img = (Image)GridView1.Rows[i].FindControl("img");
        cate = (Label)GridView1.Rows[i].FindControl("cate");
        color = (Label)GridView1.Rows[i].FindControl("color");
        size = (Label)GridView1.Rows[i].FindControl("size");
        id = (Label)GridView1.Rows[i].FindControl("id");
        myorderdetail.ordernum = Session["ordernum"].ToString();
        myorderdetail.sumweight = sumweight.Text;
        myorderdetail.sumprice =Convert .ToDouble ( sumprice.Text);
        myorderdetail.weight = weight.Text;
        myorderdetail.count =Convert .ToInt32( count.Text);
        myorderdetail.price =Convert .ToDouble ( localprice.Text);
        myorderdetail.title = title.Text;
        myorderdetail.proimage = img.ImageUrl;
        myorderdetail.cate = cate.Text;
        myorderdetail.color = color.Text;
        myorderdetail.size = size.Text;
        myorderdetail.proid =Convert .ToInt32 ( id.Text);
        result2 = blll.insertdetail(myorderdetail);
        }
        if (result > 0&&result2 >0)
        {
            Response .Redirect ("shoplist3.aspx");
        }
        else
        {
            Common.MessageAlert.Alert(Page, "提交失败!");
        }
    }