Esempio n. 1
0
        public void BindData()
        {
            #region
            //if (!Context.User.Identity.IsAuthenticated)
            //{
            //    return;
            //}
            //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name);
            //if (user.HasPermissionID(PermId_Modify))
            //{
            //    gridView.Columns[6].Visible = true;
            //}
            //if (user.HasPermissionID(PermId_Delete))
            //{
            //    gridView.Columns[7].Visible = true;
            //}
            #endregion

            DataSet       ds       = new DataSet();
            StringBuilder strWhere = new StringBuilder();
            if (txtKeyword.Text.Trim() != "")
            {
                #warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称
                //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim());
            }
            ds = bll.GetList(strWhere.ToString());
            gridView.DataSource = ds;
            gridView.DataBind();
        }
Esempio n. 2
0
        protected void RadLV_splb_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            string Collectid = e.CommandArgument.ToString();

            if (e.CommandName == "Delete")
            {
                string AppriseID1;
                AppriseID1 = e.CommandArgument.ToString();
                Appraise_Bll.DeleteList(e.CommandArgument.ToString());
                RadLV_splb.Rebind();//删除
            }
            if (e.CommandName == "Join")
            {
                string CommodityID1;
                CommodityID1 = e.CommandArgument.ToString();
                Maticsoft.Model.Commodity modelCommodity = Commodity_Bll.GetModel(CommodityID1.ToString());
                if (ShoppingCart_Bll.GetRecordCount(" CommodityID='" + CommodityID1 + "' and UserID='" + UsersInfo.UserID + "' ") > 0)
                {
                    Maticsoft.Model.ShoppingCart modelShoppingCart = ShoppingCart_Bll.GetModel(CommodityID1.ToString());
                    string id = ShoppingCart_Bll.GetList(" CommodityID='" + CommodityID1 + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    modelShoppingCart = ShoppingCart_Bll.GetModel(id);
                    modelShoppingCart.ShoppingCartID = modelShoppingCart.ShoppingCartID;
                    modelShoppingCart.UserID         = UsersInfo.UserID;
                    modelShoppingCart.CommodityID    = modelCommodity.CommodityID;
                    modelShoppingCart.OrderNumber    = modelShoppingCart.OrderNumber + 1;

                    if (modelShoppingCart.OrderNumber > modelCommodity.Stock)
                    {
                        RadAjaxManager1.Alert("库存不足!");
                        return;
                    }
                    ShoppingCart_Bll.Update(modelShoppingCart);
                }
                else
                {
                    Maticsoft.Model.Users modelusers = Users_Bll.GetModel(UsersInfo.UserID);
                    decimal discount1;
                    if (modelusers.UserGrade == "VIP")
                    {
                        discount1 = Convert.ToDecimal(0.95);
                    }
                    else
                    {
                        discount1 = Convert.ToDecimal(1);
                    }
                    ShoppingCart_Mol.ShoppingCartID = DateTime.Now.ToString("yyyyMMddhhmmss");
                    ShoppingCart_Mol.UserID         = UsersInfo.UserID;
                    ShoppingCart_Mol.CommodityID    = CommodityID1;
                    ShoppingCart_Mol.OrderNumber    = 1;
                    ShoppingCart_Mol.Subtotal       = ((ShoppingCart_Mol.OrderNumber * modelCommodity.VIPPrice) * discount1).ToString();
                    ShoppingCart_Bll.Add(ShoppingCart_Mol);
                }
                RadAjaxManager1.Alert("已添加到购物车!");
            }
        }
Esempio n. 3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //if (UsersInfo.UserID == "")
            //{
            //    Response.Write("<script> alert('请先登录!'); window.location.href='../Login.aspx' </script>");
            //    return;
            //}

            decimal discount;

            Commodity_Mol = Commodity_Bll.GetModel(Request.QueryString["ID"].ToString());
            if (UsersInfo.UserID == "")
            {
                discount = Convert.ToDecimal(1);
                ShoppingItem ShoppingItem = new ShoppingItem();
                if (ShoppingCar.ShoppingList.Where(x => x.CommodityID == Request.QueryString["ID"].ToString()).Count() > 0)                      //判断是否购买商品
                {
                    ShoppingItem = ShoppingCar.ShoppingList.Where(x => x.CommodityID == Request.QueryString["ID"].ToString()).SingleOrDefault(); //获取ID
                    if (Commoditynum.Text == "")
                    {
                        RadAjaxManager1.Alert("请输入数量!");
                        return;
                    }
                    int goodsnum = ShoppingItem.OrderNumber + Convert.ToInt32(Commoditynum.Text);//数量
                    if (goodsnum > Commodity_Mol.Stock)
                    {
                        RadAjaxManager1.Alert("库存不足!");
                        return;
                    }
                    ShoppingItem.CommodityID    = Request.QueryString["ID"].ToString();                            //商品ID
                    ShoppingItem.CommodityImage = Commodity_Mol.CommodityImage;                                    //商品图片
                    ShoppingItem.CommodityName  = Commodity_Mol.CommodityName;                                     //商品名称
                    ShoppingItem.VIPPrice       = Convert.ToDecimal(Commodity_Mol.VIPPrice);                       //商品会员价
                    ShoppingItem.Subtotal       = goodsnum * Convert.ToDecimal(Commodity_Mol.VIPPrice) * discount; //商品小计
                    //ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.CommodityID == Request.QueryString["ID"].ToString()).SingleOrDefault());//移除
                    //ShoppingCar.ShoppingList.Add(ShoppingItem);
                    RadAjaxManager1.Alert("已加入购物车!");
                }
                else
                {
                    discount = Convert.ToDecimal(1);
                    ShoppingItem.ShoppingCartID = DateTime.Now.ToString("yyyyMMddHHmmssms");//购物车ID
                    if (Commoditynum.Text == "")
                    {
                        RadAjaxManager1.Alert("请输入数量!");
                        return;
                    }
                    ShoppingItem.OrderNumber = Convert.ToInt32(Commoditynum.Text);//购物车数量
                    if (ShoppingItem.OrderNumber > Commodity_Mol.Stock)
                    {
                        RadAjaxManager1.Alert("库存不足!");
                        return;
                    }
                    ShoppingItem.CommodityID    = Request.QueryString["ID"].ToString();                                                        //商品ID
                    ShoppingItem.CommodityImage = Commodity_Mol.CommodityImage;                                                                //商品图片
                    ShoppingItem.CommodityName  = Commodity_Mol.CommodityName;                                                                 //商品名称
                    ShoppingItem.VIPPrice       = Convert.ToDecimal(Commodity_Mol.VIPPrice);                                                   //商品会员价
                    ShoppingItem.Subtotal       = Convert.ToDecimal(Commoditynum.Text) * Convert.ToDecimal(Commodity_Mol.VIPPrice) * discount; //商品小计
                    ShoppingCar.ShoppingList.Add(ShoppingItem);                                                                                //添加
                    RadAjaxManager1.Alert("添加成功!");
                    return;
                }
            }

            else
            {
                Maticsoft.Model.Users modelusers = Users_Bll.GetModel(UsersInfo.UserID);
                decimal discount1;
                if (modelusers.UserGrade == "VIP")
                {
                    discount1 = Convert.ToDecimal(0.95);
                }
                else
                {
                    discount1 = Convert.ToDecimal(1);
                }
                if (num > Convert.ToInt32(Label7.Text))
                {
                    RadAjaxManager1.Alert("数量不能超过库存!");
                    return;
                }
                if (ShoppingCart_Bll.GetRecordCount(" CommodityID='" + Request.QueryString["ID"] + "' and UserID='" + UsersInfo.UserID + "' ") > 0)
                {
                    Maticsoft.Model.Commodity    modelCommodity    = Commodity_Bll.GetModel(Request.QueryString["ID"].ToString());
                    Maticsoft.Model.ShoppingCart modelShoppingCart = ShoppingCart_Bll.GetModel(Request.QueryString["ID"].ToString());
                    string id = ShoppingCart_Bll.GetList(" CommodityID='" + Request.QueryString["ID"] + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    ShoppingCart_Mol = ShoppingCart_Bll.GetModel(id);
                    ShoppingCart_Mol.ShoppingCartID = ShoppingCart_Mol.ShoppingCartID;
                    ShoppingCart_Mol.UserID         = UsersInfo.UserID;
                    ShoppingCart_Mol.CommodityID    = modelCommodity.CommodityID;
                    if (Commoditynum.Text == "")
                    {
                        RadAjaxManager1.Alert("请输入数量!");
                        return;
                    }


                    ShoppingCart_Mol.OrderNumber = Convert.ToInt32(Commoditynum.Text) + ShoppingCart_Mol.OrderNumber;

                    if (ShoppingCart_Mol.OrderNumber > modelCommodity.Stock)
                    {
                        RadAjaxManager1.Alert("库存不足!");
                        return;
                    }

                    ShoppingCart_Mol.Subtotal = (ShoppingCart_Mol.OrderNumber * Convert.ToInt32(modelCommodity.VIPPrice) * discount1).ToString();//商品小计

                    ShoppingCart_Bll.Update(ShoppingCart_Mol);
                }
                else
                {
                    Maticsoft.Model.Commodity modelCommodity = Commodity_Bll.GetModel(Request.QueryString["ID"].ToString());
                    ShoppingCart_Mol.ShoppingCartID = DateTime.Now.ToString("yyyyMMddhhmmss");
                    ShoppingCart_Mol.UserID         = UsersInfo.UserID;
                    ShoppingCart_Mol.CommodityID    = Request.QueryString["ID"];
                    ShoppingCart_Mol.OrderNumber    = Convert.ToInt32(Commoditynum.Text);
                    ShoppingCart_Mol.Subtotal       = (Convert.ToInt32(Commoditynum.Text) * Convert.ToInt32(modelCommodity.VIPPrice) * discount1).ToString();//商品小计
                    ShoppingCart_Mol.OrderNumber    = Convert.ToInt32(Commoditynum.Text);

                    if (ShoppingCart_Mol.OrderNumber > modelCommodity.Stock)
                    {
                        RadAjaxManager1.Alert("库存不足!");
                        return;
                    }
                    ShoppingCart_Bll.Add(ShoppingCart_Mol);
                }
                RadAjaxManager1.Alert("已添加到购物车!");
            }
        }
Esempio n. 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string username   = "******";
            Regex  rxusername = new Regex(username);

            Label1.Text = "";
            Label2.Text = "";
            Label3.Text = "";
            if (RadTextBox1.Text == "")
            {
                Label1.Text    = "账户不能为空";
                Label1.Visible = true;
                return;
            }
            if (RadTextBox3.Text == "")
            {
                Label2.Text    = "密码不能为空";
                Label2.Visible = true;
                return;
            }
            if (RadTextBox2.Text == "")
            {
                Label3.Text    = "验证码不能为空";
                Label3.Visible = true;
                return;
            }
            if (!rxusername.IsMatch(RadTextBox1.Text))
            {
                Label1.Text    = "账户格式错误";
                Label1.Visible = true;
                return;
            }
            if (User_Bll.GetRecordCount(" Username='******' ") == 0)
            {
                Label1.Text    = "该账户不存在";
                Label1.Visible = true;
                return;
            }
            if (!rxusername.IsMatch(RadTextBox3.Text))
            {
                Label1.Text    = "密码格式错误";
                Label1.Visible = true;
                return;
            }
            if (User_Bll.GetRecordCount(" Username='******' and UserPassword='******'") == 0)
            {
                Label2.Text    = "密码错误";
                Label2.Visible = true;
                return;
            }
            if (Session["CheckCode"].ToString().ToLower() != RadTextBox2.Text.ToLower())
            {
                Label3.Text    = "验证码错误";
                Label3.Visible = true;
                return;
            }

            DataSet ds = User_Bll.GetList(" Username='******' ");

            UsersInfo.UserID   = ds.Tables[0].Rows[0]["UserID"].ToString();
            UsersInfo.UserRole = ds.Tables[0].Rows[0]["UserIdentity"].ToString();
            UsersInfo.UserName = ds.Tables[0].Rows[0]["Username"].ToString();
            if (ds.Tables[0].Rows[0]["UserIdentity"].ToString() == "管理员")
            {
                RadAjaxManager1.Alert("该账户无效!");
                RadTextBox1.Text = "";
                RadTextBox2.Text = "";
                RadTextBox3.Text = "";
                return;
            }
            if (ShoppingCar.ShoppingList.Count != 0)
            {
                Users_Mol = User_Bll.GetModel(UsersInfo.UserID);
                decimal discount1;
                if (Users_Mol.UserGrade == "VIP")
                {
                    discount1 = Convert.ToDecimal(0.95);
                }
                else
                {
                    discount1 = Convert.ToDecimal(1);
                }
                if (ShoppingCar.ShoppingList.Count != 0)    //泛型中有数据
                {
                    int i = 0;
                    foreach (var item in ShoppingCar.ShoppingList)
                    {
                        Commodity_Mol = Commodity_Bll.GetModel(item.CommodityID);
                        if (ShoppingCart_Bll.GetRecordCount(" UserID ='" + UsersInfo.UserID + "' and CommodityID ='" + item.CommodityID + "' ") != 0)
                        {
                            string basketid = ShoppingCart_Bll.GetList(" UserID ='" + UsersInfo.UserID + "' and CommodityID ='" + item.CommodityID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                            ShoppingCart_Mol             = ShoppingCart_Bll.GetModel(basketid);
                            ShoppingCart_Mol.OrderNumber = ShoppingCart_Mol.OrderNumber + item.OrderNumber;
                            if (ShoppingCart_Mol.OrderNumber > Commodity_Mol.Stock)
                            {
                                ShoppingCart_Mol.OrderNumber = Commodity_Mol.Stock;
                            }
                            ShoppingCart_Mol.Subtotal = (Convert.ToDecimal(ShoppingCart_Mol.OrderNumber) * Convert.ToDecimal(item.VIPPrice) * discount1).ToString("F2");
                            ShoppingCart_Bll.Update(ShoppingCart_Mol);
                        }
                        else
                        {
                            ShoppingCart_Mol.ShoppingCartID = DateTime.Now.ToString("yyyyMMddHHmmss") + i.ToString();
                            i++;
                            ShoppingCart_Mol.UserID      = UsersInfo.UserID;
                            ShoppingCart_Mol.CommodityID = item.CommodityID;
                            ShoppingCart_Mol.OrderNumber = item.OrderNumber;
                            if (ShoppingCart_Mol.OrderNumber > Commodity_Mol.Stock)
                            {
                                ShoppingCart_Mol.OrderNumber = Commodity_Mol.Stock;
                            }
                            ShoppingCart_Mol.Subtotal = (item.Subtotal * discount1).ToString("F2");
                            ShoppingCart_Bll.Add(ShoppingCart_Mol);
                        }
                    }
                    ShoppingCar.ShoppingList.Clear();
                }
            }
            Response.Redirect("HomePage.aspx");
        }
Esempio n. 5
0
        protected void RadLV_splb_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            if (e.CommandName == "buy")
            {
                string CommodityID1;
                CommodityID1 = e.CommandArgument.ToString();
                decimal discount1 = Convert.ToDecimal(1);
                Maticsoft.Model.Users     modelusers   = Users_Bll.GetModel(UsersInfo.UserID);
                Maticsoft.Model.Commodity Commoditymol = Commodity_Bll.GetModel(CommodityID1);

                if (UsersInfo.UserID == "")
                {
                    ShoppingItem ShoppingItem = new ShoppingItem();
                    if (ShoppingCar.ShoppingList.Where(x => x.CommodityID == CommodityID1).Count() > 0)                                     //判断是否购买商品
                    {
                        ShoppingItem                = ShoppingCar.ShoppingList.Where(x => x.CommodityID == CommodityID1).SingleOrDefault(); //获取ID
                        ShoppingItem.CommodityID    = CommodityID1;                                                                         //商品ID
                        ShoppingItem.CommodityImage = Commoditymol.CommodityImage;                                                          //商品图片
                        ShoppingItem.CommodityName  = Commoditymol.CommodityName;                                                           //商品名称
                        ShoppingItem.VIPPrice       = Convert.ToDecimal(Commoditymol.VIPPrice);                                             //商品会员价
                        ShoppingItem.OrderNumber    = ShoppingItem.OrderNumber + 1;                                                         //数量
                        if (ShoppingItem.OrderNumber > Commoditymol.Stock)
                        {
                            ShoppingItem.OrderNumber = Convert.ToInt32(Commoditymol.Stock);
                            RadAjaxManager1.Alert("库存不足!");
                            return;
                        }

                        ShoppingItem.Subtotal = ShoppingItem.OrderNumber * Convert.ToDecimal(Commoditymol.VIPPrice) * discount1;               //商品小计
                        ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.CommodityID == CommodityID1).SingleOrDefault()); //移除
                        ShoppingCar.ShoppingList.Add(ShoppingItem);
                        RadAjaxManager1.Alert("已加入购物车!");
                    }
                    else
                    {
                        ShoppingItem.ShoppingCartID = DateTime.Now.ToString("yyyyMMddHHmmssms"); //购物车ID
                        ShoppingItem.CommodityID    = CommodityID1;                              //商品ID
                        ShoppingItem.CommodityImage = Commoditymol.CommodityImage;               //商品图片
                        ShoppingItem.CommodityName  = Commoditymol.CommodityName;                //商品名称
                        ShoppingItem.VIPPrice       = Convert.ToDecimal(Commoditymol.VIPPrice);  //商品会员价
                        ShoppingItem.OrderNumber    = 1;                                         //商品数量
                        if (ShoppingItem.OrderNumber > Commoditymol.Stock)
                        {
                            RadAjaxManager1.Alert("库存不足!");
                            return;
                        }
                        ShoppingItem.Subtotal = Convert.ToDecimal(Commoditymol.VIPPrice) * discount1; //商品小计
                        ShoppingCar.ShoppingList.Add(ShoppingItem);                                   //添加
                        RadAjaxManager1.Alert("添加成功!");
                        return;
                    }
                }
                else if (ShoppingCart_Bll.GetRecordCount(" CommodityID='" + CommodityID1 + "' and UserID='" + UsersInfo.UserID + "' ") > 0)
                {
                    if (modelusers.UserGrade == "VIP")
                    {
                        discount1 = Convert.ToDecimal(0.95);
                    }
                    else
                    {
                        discount1 = Convert.ToDecimal(1);
                    }
                    Maticsoft.Model.Commodity modelCommodity = Commodity_Bll.GetModel(CommodityID1);
                    string id = ShoppingCart_Bll.GetList(" CommodityID='" + CommodityID1 + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    ShoppingCart_Mol = ShoppingCart_Bll.GetModel(id);
                    ShoppingCart_Mol.ShoppingCartID = ShoppingCart_Mol.ShoppingCartID;
                    ShoppingCart_Mol.UserID         = UsersInfo.UserID;
                    ShoppingCart_Mol.CommodityID    = modelCommodity.CommodityID;
                    ShoppingCart_Mol.OrderNumber    = ShoppingCart_Mol.OrderNumber + 1;
                    ShoppingCart_Mol.Subtotal       = (Convert.ToInt32(modelCommodity.VIPPrice) * discount1).ToString();//商品小计

                    if (ShoppingCart_Mol.OrderNumber > modelCommodity.Stock)
                    {
                        Response.Write("<script>alert('库存不足!')</script>");
                        return;
                    }
                    ShoppingCart_Bll.Update(ShoppingCart_Mol);
                    Response.Write("<script>alert('已添加到购物车!')</script>");
                }
                else
                {
                    Maticsoft.Model.Commodity modelCommodity = Commodity_Bll.GetModel(CommodityID1);
                    ShoppingCart_Mol.ShoppingCartID = DateTime.Now.ToString("yyyyMMddhhmmss");
                    ShoppingCart_Mol.UserID         = UsersInfo.UserID;
                    ShoppingCart_Mol.CommodityID    = e.CommandArgument.ToString();
                    ShoppingCart_Mol.OrderNumber    = 1;
                    ShoppingCart_Mol.Subtotal       = (1 * Convert.ToInt32(modelCommodity.VIPPrice) * discount1).ToString();//商品小计
                    ShoppingCart_Bll.Add(ShoppingCart_Mol);
                    Response.Write("<script>alert('已添加到购物车!')</script>");
                }
            }
        }
Esempio n. 6
0
        protected void RadListView1_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            string ShoppingCartID1;

            ShoppingCartID1 = e.CommandArgument.ToString();
            Telerik.Web.UI.RadNumericTextBox Commoditynum      = e.ListViewItem.FindControl("Commoditynum") as Telerik.Web.UI.RadNumericTextBox;
            Maticsoft.Model.ShoppingCart     modelShoppingCart = ShoppingCart_Bll.GetModel(ShoppingCartID1);
            Maticsoft.Model.Users            modelUsers        = Users_Bll.GetModel(UsersInfo.UserID);
            if (e.CommandName == "Delete")
            {
                if (UsersInfo.UserID != "")
                {
                    ShoppingCart_Bll.DeleteList(e.CommandArgument.ToString());
                    RadListView1.Rebind();//删除
                    if (ShoppingCart_Bll.GetRecordCount3("a.CommodityID = b.CommodityID and a.UserID='" + UsersInfo.UserID + "'") == 0)
                    {
                        content_buy.Visible = false;
                    }
                }
                else
                {
                    string       id = e.CommandArgument.ToString();
                    ShoppingItem si = new ShoppingItem();
                    si = ShoppingCar.ShoppingList.Where(x => x.CommodityID == id).SingleOrDefault();

                    ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.ShoppingCartID == id).SingleOrDefault());
                    ShoppingItem jsnum  = new ShoppingItem();
                    decimal      zongji = 0;
                    foreach (var item in ShoppingCar.ShoppingList)
                    {
                        zongji += item.Subtotal;
                        Lbl_totalprice.Text = zongji.ToString();
                    }
                    hidden();
                    RadListView1.Rebind();//刷新
                }
            }
            if (e.CommandName == "Add")
            {
                string CommodityID1;
                CommodityID1 = e.CommandArgument.ToString();
                Maticsoft.Model.Commodity modelCommodity = Commodity_Bll.GetModel(CommodityID1);
                num = Convert.ToInt32(Commoditynum.Text);
                if (num < Convert.ToInt32(modelCommodity.Stock))
                {
                    num++;
                    Commoditynum.Text = num.ToString();
                }
                else
                {
                    Commoditynum.Text = num.ToString();
                }
                if (UsersInfo.UserID != "")
                {
                    string CommodityID2;
                    CommodityID2 = e.CommandArgument.ToString();

                    string ShoppingCartID2 = ShoppingCart_Bll.GetList(" CommodityID='" + CommodityID2 + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    Maticsoft.Model.Commodity modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelUsers      = Users_Bll.GetModel(UsersInfo.UserID);
                    decimal discount1;
                    if (modelUsers.UserGrade == "VIP")
                    {
                        discount1 = Convert.ToDecimal(0.95);
                    }
                    else
                    {
                        discount1 = Convert.ToDecimal(1);
                    }
                    modelShoppingCart             = ShoppingCart_Bll.GetModel(ShoppingCartID2);                                                              //获取id所在行数据
                    modelShoppingCart.OrderNumber = Convert.ToInt32(Commoditynum.Text);                                                                      //商品数量
                    modelShoppingCart.Subtotal    = (Convert.ToInt32(Commoditynum.Text) * Convert.ToInt32(modelCommodity2.VIPPrice) * discount1).ToString(); //商品小计
                    ShoppingCart_Bll.Update(modelShoppingCart);
                    RadListView1.Rebind();
                }
                else
                {
                    string CommodityID3;
                    CommodityID3 = e.CommandArgument.ToString();
                    ShoppingItem si = new ShoppingItem();
                    si            = ShoppingCar.ShoppingList.Where(x => x.CommodityID == CommodityID3).First();
                    Commodity_Mol = Commodity_Bll.GetModel(si.CommodityID);
                    if (si.OrderNumber + 1 <= Commodity_Mol.Stock)
                    {
                        int num1 = si.OrderNumber + 1;
                        si.OrderNumber = num1;
                        Decimal b = num * Convert.ToDecimal(Commodity_Mol.VIPPrice) * 1;
                        si.Subtotal = b;
                        ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.CommodityID == CommodityID3).SingleOrDefault());
                        ShoppingCar.ShoppingList.Add(si);
                        ShoppingItem jsnum  = new ShoppingItem();
                        decimal      zongji = 0;
                        foreach (var item in ShoppingCar.ShoppingList)
                        {
                            zongji += item.Subtotal;
                            Lbl_totalprice.Text = zongji.ToString();
                        }
                        RadListView1.Rebind();
                    }
                    else
                    {
                        RadAjaxManager1.Alert("已经最大了");
                    }
                }
            }
            if (e.CommandName == "Jian")
            {
                num = Convert.ToInt32(Commoditynum.Text);
                if (num <= 0)
                {
                    num = 1;
                }
                else
                {
                    num--;
                }
                Commoditynum.Text = num.ToString();

                if (UsersInfo.UserID != "")
                {
                    string CommodityID2;
                    CommodityID2 = e.CommandArgument.ToString();
                    string ShoppingCartID2 = ShoppingCart_Bll.GetList(" CommodityID='" + CommodityID2 + "' and UserID='" + UsersInfo.UserID + "' ").Tables[0].Rows[0]["ShoppingCartID"].ToString();
                    Maticsoft.Model.Commodity modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelCommodity2 = Commodity_Bll.GetModel(CommodityID2);
                    modelUsers      = Users_Bll.GetModel(UsersInfo.UserID);
                    decimal discount1;
                    if (modelUsers.UserGrade == "VIP")
                    {
                        discount1 = Convert.ToDecimal(0.95);
                    }
                    else
                    {
                        discount1 = Convert.ToDecimal(1);
                    }
                    modelShoppingCart             = ShoppingCart_Bll.GetModel(ShoppingCartID2);                                                              //获取id所在行数据
                    modelShoppingCart.OrderNumber = Convert.ToInt32(Commoditynum.Text);                                                                      //商品数量
                    modelShoppingCart.Subtotal    = (Convert.ToInt32(Commoditynum.Text) * Convert.ToInt32(modelCommodity2.VIPPrice) * discount1).ToString(); //商品小计
                    ShoppingCart_Bll.Update(modelShoppingCart);
                    RadListView1.Rebind();
                }
                else
                {
                    string       id = e.CommandArgument.ToString();
                    ShoppingItem si = new ShoppingItem();
                    si = ShoppingCar.ShoppingList.Where(x => x.CommodityID == id).First();
                    if (si.OrderNumber > 1)
                    {
                        int num1 = si.OrderNumber - 1;
                        si.OrderNumber = num1;
                        Commodity_Mol  = Commodity_Bll.GetModel(si.CommodityID);
                        Decimal b = num * Convert.ToDecimal(Commodity_Mol.VIPPrice) * 1;
                        si.Subtotal = b;
                        ShoppingCar.ShoppingList.Remove(ShoppingCar.ShoppingList.Where(x => x.CommodityID == id).SingleOrDefault());
                        ShoppingCar.ShoppingList.Add(si);
                        ShoppingItem jsnum  = new ShoppingItem();
                        decimal      zongji = 0;
                        foreach (var item in ShoppingCar.ShoppingList)
                        {
                            zongji += item.Subtotal;
                            Lbl_totalprice.Text = zongji.ToString();
                        }
                        RadListView1.Rebind();
                    }
                    else
                    {
                        RadAjaxManager1.Alert("已经最小了");
                    }
                }
            }
        }