protected void Page_Load(object sender, EventArgs e)
        {
            this.radMatch.Items[0].Text   = "模糊匹配";
            this.radMatch.Items[1].Text   = "精确匹配";
            this.radDisable.Items[0].Text = "启用";
            this.radDisable.Items[1].Text = "禁用";
            this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
            this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
            IList <CouponInfo> allUsedCoupons = CouponHelper.GetAllUsedCoupons(1);

            if (allUsedCoupons != null && allUsedCoupons.Count > 0)
            {
                foreach (CouponInfo item in allUsedCoupons)
                {
                    if (CouponHelper.GetCouponSurplus(item.CouponId) > 0)
                    {
                        this.ddlCoupon.Items.Add(new ListItem(item.CouponName.ToNullString(), item.CouponId.ToNullString()));
                    }
                }
            }
            if (this.ddlCoupon.Items.Count == 0)
            {
                this.ddlsubType.Items.RemoveAt(1);
                this.ddlCoupon.Items.Add(new ListItem("请选择优惠券", "0"));
            }
            if (!this.chkNo.Enabled)
            {
                this.chkNo.ToolTip = "该类型已被使用";
            }
            if (!this.chkSub.Enabled)
            {
                this.chkSub.ToolTip = "该类型已被使用";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.radMatch.Items[0].Text   = "模糊匹配";
            this.radMatch.Items[1].Text   = "精确匹配";
            this.radDisable.Items[0].Text = "启用";
            this.radDisable.Items[1].Text = "禁用";
            this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
            this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
            if (!this.chkNo.Enabled)
            {
                this.chkNo.ToolTip = "该类型已被使用";
            }
            if (!this.chkSub.Enabled)
            {
                this.chkSub.ToolTip = "该类型已被使用";
            }
            IList <CouponInfo> allUsedCoupons = CouponHelper.GetAllUsedCoupons(1);

            if (allUsedCoupons != null)
            {
                foreach (CouponInfo item in allUsedCoupons)
                {
                    if (CouponHelper.GetCouponSurplus(item.CouponId) > 0)
                    {
                        this.ddlCoupon.Items.Add(new ListItem(item.CouponName.ToNullString(), item.CouponId.ToNullString()));
                    }
                }
            }
            if (this.ddlCoupon.Items.Count == 0)
            {
                this.ddlsubType.Items.RemoveAt(1);
                this.ddlCoupon.Items.Add(new ListItem("请选择优惠券", "0"));
            }
            if (!base.IsPostBack)
            {
                this.id = base.GetUrlIntParam("id");
                this.BindSingleArticle(this.id);
            }
            else
            {
                this.uploadpic.Src = this.hdpic.Value;
            }
        }
        public void BindCoupons()
        {
            this.Items.Clear();
            this.Items.Add(new ListItem
            {
                Text  = "请选择优惠券",
                Value = "0"
            });
            IList <CouponInfo> allUsedCoupons = CouponHelper.GetAllUsedCoupons(1);

            allUsedCoupons.ForEach(delegate(CouponInfo x)
            {
                if (CouponHelper.GetCouponSurplus(x.CouponId) > 0)
                {
                    this.Items.Add(new ListItem
                    {
                        Text  = x.CouponName,
                        Value = x.CouponId.ToString()
                    });
                }
            });
        }