Beispiel #1
0
 protected void RadListView1_NeedDataSource(object sender, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
 {
     if (UsersInfo.UserID == "")
     {
         RadListView1.DataSource = ShoppingCar.ShoppingList.OrderBy(x => x.ShoppingCartID);
         decimal sum = 0;
         foreach (var item in ShoppingCar.ShoppingList)
         {
             sum = sum + Convert.ToDecimal(item.Subtotal);
         }
         Lbl_totalprice.Text = sum.ToString();
     }
     else
     {
         RadListView1.DataSource = ShoppingCart_Bll.GetList2("a.CommodityID = b.CommodityID and a.UserID='" + UsersInfo.UserID + "'");
         Lbl_totalprice.Text     = ShoppingCart_Bll.GetList3("UserID='" + UsersInfo.UserID + "'").Tables[0].Rows[0][0].ToString();
     }
 }