private void rptcombinaproduct_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Control control = e.Item.Controls[0];
         CombinationBuyandProductUnionInfo combinationBuyandProductUnionInfo = (CombinationBuyandProductUnionInfo)e.Item.DataItem;
         if (combinationBuyandProductUnionInfo.HasSKU)
         {
             Panel panel = control.FindControl("Panelsku") as Panel;
             if (panel != null)
             {
                 Common_ComBinaSKUSelector common_ComBinaSKUSelector = new Common_ComBinaSKUSelector();
                 common_ComBinaSKUSelector.ProductId           = combinationBuyandProductUnionInfo.ProductId;
                 common_ComBinaSKUSelector.MinCombinationPrice = combinationBuyandProductUnionInfo.MinCombinationPrice;
                 common_ComBinaSKUSelector.TotalStock          = combinationBuyandProductUnionInfo.Totalstock;
                 common_ComBinaSKUSelector.ThumbnailUrl180     = combinationBuyandProductUnionInfo.ThumbnailUrl180;
                 common_ComBinaSKUSelector.Skus = this.AllSkus.Select("productId = " + common_ComBinaSKUSelector.ProductId);
                 panel.Controls.Add(common_ComBinaSKUSelector);
             }
         }
     }
 }
        private void SetControlsValue(int productId)
        {
            List <CombinationBuyandProductUnionInfo> combinationProductListByProductId = CombinationBuyHelper.GetCombinationProductListByProductId(productId);

            if (combinationProductListByProductId == null || combinationProductListByProductId.Count > 1)
            {
                CombinationBuyandProductUnionInfo combinationBuyandProductUnionInfo = combinationProductListByProductId.FirstOrDefault((CombinationBuyandProductUnionInfo c) => c.ProductId == productId);
                if (combinationBuyandProductUnionInfo != null)
                {
                    string text = string.Empty;
                    for (int i = 0; i < combinationProductListByProductId.Count; i++)
                    {
                        text = text + combinationProductListByProductId[i].ProductId + ",";
                    }
                    this.hidproductid.Value        = productId.ToString();
                    this.litMasterproductname.Text = "<a href=\"ProductDetails.aspx?ProductId=" + combinationBuyandProductUnionInfo.ProductId + "\">" + combinationBuyandProductUnionInfo.ProductName + "</a>";
                    Literal literal = this.litMasterprice;
                    decimal num     = combinationBuyandProductUnionInfo.MinCombinationPrice;
                    literal.Text = num.ToString();
                    Literal  literal2 = this.litMasterproductpic;
                    string[] obj      = new string[5]
                    {
                        "<a href=\"ProductDetails.aspx?ProductId=",
                        null,
                        null,
                        null,
                        null
                    };
                    int num2 = combinationBuyandProductUnionInfo.ProductId;
                    obj[1]        = num2.ToString();
                    obj[2]        = "\" class=\"cart_1\"><img src=\"";
                    obj[3]        = (string.IsNullOrEmpty(combinationBuyandProductUnionInfo.ThumbnailUrl180) ? HiContext.Current.SiteSettings.DefaultProductImage : combinationBuyandProductUnionInfo.ThumbnailUrl180);
                    obj[4]        = "\"></a>";
                    literal2.Text = string.Concat(obj);
                    Literal literal3 = this.litMastersaleprice;
                    num           = combinationBuyandProductUnionInfo.MinSalePrice;
                    literal3.Text = num.ToString();
                    this.AllSkus  = CombinationBuyHelper.GetSkus(text.Substring(0, text.Length - 1));
                    if (!combinationBuyandProductUnionInfo.HasSKU)
                    {
                        this.selectmainsku.Visible        = false;
                        this.hidmasterproducthassku.Value = "0";
                        this.hidmasterselectsku.Value     = productId + "_0";
                    }
                    else
                    {
                        this.hidmasterselectsku.Value     = "0";
                        this.hidmasterproducthassku.Value = "1";
                        Common_ComBinaSKUSelector common_ComBinaSKUSelector = new Common_ComBinaSKUSelector();
                        common_ComBinaSKUSelector.ProductId           = combinationBuyandProductUnionInfo.ProductId;
                        common_ComBinaSKUSelector.MinCombinationPrice = combinationBuyandProductUnionInfo.MinCombinationPrice;
                        common_ComBinaSKUSelector.TotalStock          = combinationBuyandProductUnionInfo.Totalstock;
                        common_ComBinaSKUSelector.ThumbnailUrl180     = combinationBuyandProductUnionInfo.ThumbnailUrl180;
                        common_ComBinaSKUSelector.Skus = this.AllSkus.Select("productId = " + productId);
                        this.Controls.Add(common_ComBinaSKUSelector);
                    }
                    HtmlInputHidden htmlInputHidden = this.hidmasterstock;
                    num2 = combinationBuyandProductUnionInfo.Totalstock;
                    htmlInputHidden.Value = num2.ToString();
                    HtmlInputHidden htmlInputHidden2 = this.hidcombinaid;
                    num2 = combinationBuyandProductUnionInfo.CombinationId;
                    htmlInputHidden2.Value = num2.ToString();
                    combinationProductListByProductId.Remove(combinationBuyandProductUnionInfo);
                    this.rptcombinaproduct.DataSource = combinationProductListByProductId;
                    this.rptcombinaproduct.DataBind();
                    this.AllSkus.Dispose();
                }
                else
                {
                    this.ShowWapMessage("活动已结束或不存在", "ProductDetails.aspx?productId=" + productId);
                }
            }
            else
            {
                this.ShowWapMessage("活动已结束或不存在", "ProductDetails.aspx?productId=" + productId);
            }
        }