Example #1
0
        private void BindPromotionGifts(PromotionInfo promotion)
        {
            this.hidSelectGiftId.Value = promotion.GiftIds.ToString();
            IList <GiftInfo> giftDetailsByGiftIds = GiftHelper.GetGiftDetailsByGiftIds(promotion.GiftIds);

            if (giftDetailsByGiftIds.Count != 0)
            {
                StringBuilder stringBuilder = new StringBuilder();
                foreach (GiftInfo item in giftDetailsByGiftIds)
                {
                    stringBuilder.Append(item.GiftId + "|||" + item.Name + "|||" + (item.CostPrice.HasValue ? item.CostPrice.Value.F2ToString("f2") : "0") + ",,,");
                }
                if (stringBuilder.ToString().Length > 0)
                {
                    HiddenField hiddenField  = this.hidAllSelectedGifts;
                    HiddenField hiddenField2 = this.hidSelectGifts;
                    string      text3        = hiddenField.Value = (hiddenField2.Value = stringBuilder.ToString().Substring(0, stringBuilder.Length - 3));
                }
            }
        }