コード例 #1
0
ファイル: Site1.Master.cs プロジェクト: sagitab/FlyPack
 protected void OrderNow_OnClick(object sender, EventArgs e)
 {
     if (IsGoodAmount())
     {
         List <BLOrderDetailsDB> orderDetails = (List <BLOrderDetailsDB>)Session["orderDetails"];
         BLProduct product = BLProduct.GetProductById(orderDetails[0].productId);
         int       shopId  = BLProduct.GetShopIdByProductId(product.Id); //get shop id
         Response.Redirect("OrderNow.aspx?shopId=" + shopId);            //pass shop id in qwaery string
     }
     else
     {
         //msg!!!!!!!!!!!!!!!!!!!!
     }
 }
コード例 #2
0
ファイル: Site1.Master.cs プロジェクト: sagitab/FlyPack
        public void Update(List <BLOrderDetailsDB> orderDetails)
        {
            List <BLProduct> products = new List <BLProduct>();

            if (orderDetails != null)
            {
                products.AddRange(orderDetails.Select(detail => BLProduct.GetProductById(detail.productId)));
                EmptyCart.Visible = true;
            }
            ProductsCart.DataSource = products;
            Session["orderDetails"] = orderDetails;
            ProductsCart.DataBind();
            UpdateSumCart(orderDetails);
            if (orderDetails == null || orderDetails.Count == 0)
            {
                MSG.Text           = "there is no products"; //error msg
                NumOfProducts.Text = "";
                TotalPrice.Text    = "";
                OrderNow.Visible   = false;
                return;
            }
            MSG.Text = "";
        }