注册 登录
编程论坛 C# 论坛

求助 '=' 附近有语法错误

编程学者989 发布于 2014-04-30 15:11, 706 次点击
只有本站会员才能查看附件,请 登录

购物车中去付款的代码:
protected void Button1_Click(object sender, EventArgs e)
        {

            Maticsoft.BLL.ShoppingCart cart = Session["ShoppingCart"] as Maticsoft.BLL.ShoppingCart;
            if (cart != null)
            {
                Maticsoft.Model.Users user = Session["user"] as Maticsoft.Model.Users;
                Maticsoft.BLL.Order orders = new Maticsoft.BLL.Order();
                if (user != null)
                {
                    string strWhere = string.Format("Uid={0}", user.id);
                    Maticsoft.BLL.Site siteBll = new Maticsoft.BLL.Site();

                    List<Maticsoft.Model.Site> userSiteList = siteBll.GetModelList(strWhere);

                    if (RadioButtonList1.SelectedIndex > -1)
                    {
                        int i = RadioButtonList1.SelectedIndex;
                        string nameStr = userSiteList[i].ReceiverName;
                        string phoneStr = userSiteList[i].Phone;
                        string addressStr = userSiteList[i].Address;
                        int j = DropDownList1.SelectedIndex;
                        int fight;
                        string express;
                        if (j == 0)
                        {
                            fight = 5;
                            express = "快递";
                        }
                        else if (j == 1)
                        {
                            fight = 10;
                            express = "平邮";
                        }
                        else
                        {
                            fight = 15;
                            express = "EMS";
                        }

                        // Label1.Text = "You selected: " + RadioButtonList1.SelectedItem.Text + "INDEX:" + RadioButtonList1.SelectedIndex+"****"+fight+"****"+express;
                        //Maticsoft.BLL.ShoppingCart cart = Session["ShoppingCart"] as Maticsoft.BLL.ShoppingCart;
                        Maticsoft.Model.Order order = new Model.Order();
                        decimal money1 = order.Total + fight;
                        if (money1 > user.Ubalance)
                        {
                            (this, "请先充值", "UserCenter.aspx");
                            return;
                        }
                        BLL.Order oder = new BLL.Order();
                       
                        bool bool1 = oder.CheckOut(user.id,order.Total,cart,nameStr,phoneStr,addressStr,fight,express);
                        //bool bool1 =  oder.CheckOut(user.id, cart.Total, cart, nameStr, phoneStr, addressStr, fight, express);
                        if (bool1 == true)
                        {
                            // Label1.Text = "购物成功";
                            (this, "购物成功");
                        }

                    }
                }
            }
                    else
                    {
                        (this, "请先加载购物车");
                    }
                }

        
只有本站会员才能查看附件,请 登录
5 回复
#2
xydddaxia2014-05-05 08:31
sql错了,
#3
神奈创2014-05-08 12:02
应该是你定义的sql操作字符串有问题,可能是不支持那样子的语法也可能是你要你的语句里面的元素是错的
#4
ligao682014-05-10 08:28
请问你这图片如何弄上去的啊!谢谢。。
#5
编程学者9892014-05-20 10:49
回复 4 楼 ligao68
有添加图片的功能呀。上面工具栏里有的。
#6
编程学者9892014-05-20 10:50
回复 3 楼 神奈创
谢谢~
1