Example #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemId");
            _actId = Body.GetQueryInt("actID");

            if (!IsPostBack)
            {
                var pageTitle = _actId > 0 ? "编辑优惠劵活动" : "添加优惠劵活动";
                BreadCrumb(AppManager.WeiXin.LeftMenu.IdFunction, AppManager.WeiXin.LeftMenu.Function.IdCoupon, pageTitle, AppManager.WeiXin.Permission.WebSite.Coupon);
                LtlPageTitle.Text = pageTitle;

                LtlImageUrl.Text =
                    $@"<img id=""preview_imageUrl"" src=""{CouponManager.GetImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";
                LtlContentImageUrl.Text =
                    $@"<img id=""preview_contentImageUrl"" src=""{CouponManager.GetContentImageUrl(
                        PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";
                LtlEndImageUrl.Text =
                    $@"<img id=""preview_endImageUrl"" src=""{CouponManager.GetEndImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";

                if (_actId > 0)
                {
                    var actInfo = DataProviderWx.CouponActDao.GetActInfo(_actId);

                    TbKeywords.Text       = DataProviderWx.KeywordDao.GetKeywords(actInfo.KeywordId);
                    CbIsEnabled.Checked   = !actInfo.IsDisabled;
                    DtbStartDate.DateTime = actInfo.StartDate;
                    DtbEndDate.DateTime   = actInfo.EndDate;
                    TbTitle.Text          = actInfo.Title;
                    if (!string.IsNullOrEmpty(actInfo.ImageUrl))
                    {
                        LtlImageUrl.Text =
                            $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, actInfo.ImageUrl)}"" width=""370"" align=""middle"" />";
                    }
                    TbSummary.Text = actInfo.Summary;
                    if (!string.IsNullOrEmpty(actInfo.ContentImageUrl))
                    {
                        LtlContentImageUrl.Text =
                            $@"<img id=""preview_contentImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, actInfo.ContentImageUrl)}"" width=""370"" align=""middle"" />";
                    }
                    TbContentUsage.Text       = actInfo.ContentUsage;
                    TbContentDescription.Text = actInfo.ContentDescription;
                    TbAwardCode.Text          = actInfo.AwardCode;

                    TbEndTitle.Text   = actInfo.EndTitle;
                    TbEndSummary.Text = actInfo.EndSummary;
                    if (!string.IsNullOrEmpty(actInfo.EndImageUrl))
                    {
                        LtlEndImageUrl.Text =
                            $@"<img id=""preview_endImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, actInfo.EndImageUrl)}"" width=""370"" align=""middle"" />";
                    }

                    ImageUrl.Value        = actInfo.ImageUrl;
                    ContentImageUrl.Value = actInfo.ContentImageUrl;
                    EndImageUrl.Value     = actInfo.EndImageUrl;

                    CbIsFormRealName.Checked = actInfo.IsFormRealName;
                    TbFormRealNameTitle.Text = actInfo.FormRealNameTitle;
                    CbIsFormMobile.Checked   = actInfo.IsFormMobile;
                    TbFormMobileTitle.Text   = actInfo.FormMobileTitle;
                    CbIsFormEmail.Checked    = actInfo.IsFormEmail;
                    TbFormEmailTitle.Text    = actInfo.FormEmailTitle;
                    CbIsFormAddress.Checked  = actInfo.IsFormAddress;
                    TbFormAddressTitle.Text  = actInfo.FormAddressTitle;
                }
                else
                {
                    DtbEndDate.DateTime = DateTime.Now.AddMonths(1);
                }

                BtnReturn.Attributes.Add("onclick",
                                         $@"location.href=""{PageCouponAct.GetRedirectUrl(PublishmentSystemId)}"";return false");
            }
        }
Example #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");
            actID = TranslateUtils.ToInt(GetQueryString("actID"));

            if (!IsPostBack)
            {
                var pageTitle = actID > 0 ? "编辑优惠劵活动" : "添加优惠劵活动";
                BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_Coupon, pageTitle, AppManager.WeiXin.Permission.WebSite.Coupon);
                ltlPageTitle.Text = pageTitle;

                ltlImageUrl.Text =
                    $@"<img id=""preview_imageUrl"" src=""{CouponManager.GetImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";
                ltlContentImageUrl.Text =
                    $@"<img id=""preview_contentImageUrl"" src=""{CouponManager.GetContentImageUrl(
                        PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />";
                ltlEndImageUrl.Text =
                    $@"<img id=""preview_endImageUrl"" src=""{CouponManager.GetEndImageUrl(PublishmentSystemInfo,
                        string.Empty)}"" width=""370"" align=""middle"" />";

                if (actID > 0)
                {
                    var actInfo = DataProviderWX.CouponActDAO.GetActInfo(actID);

                    tbKeywords.Text       = DataProviderWX.KeywordDAO.GetKeywords(actInfo.KeywordID);
                    cbIsEnabled.Checked   = !actInfo.IsDisabled;
                    dtbStartDate.DateTime = actInfo.StartDate;
                    dtbEndDate.DateTime   = actInfo.EndDate;
                    tbTitle.Text          = actInfo.Title;
                    if (!string.IsNullOrEmpty(actInfo.ImageUrl))
                    {
                        ltlImageUrl.Text =
                            $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, actInfo.ImageUrl)}"" width=""370"" align=""middle"" />";
                    }
                    tbSummary.Text = actInfo.Summary;
                    if (!string.IsNullOrEmpty(actInfo.ContentImageUrl))
                    {
                        ltlContentImageUrl.Text =
                            $@"<img id=""preview_contentImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, actInfo.ContentImageUrl)}"" width=""370"" align=""middle"" />";
                    }
                    tbContentUsage.Text       = actInfo.ContentUsage;
                    tbContentDescription.Text = actInfo.ContentDescription;
                    tbAwardCode.Text          = actInfo.AwardCode;

                    tbEndTitle.Text   = actInfo.EndTitle;
                    tbEndSummary.Text = actInfo.EndSummary;
                    if (!string.IsNullOrEmpty(actInfo.EndImageUrl))
                    {
                        ltlEndImageUrl.Text =
                            $@"<img id=""preview_endImageUrl"" src=""{PageUtility.ParseNavigationUrl(
                                PublishmentSystemInfo, actInfo.EndImageUrl)}"" width=""370"" align=""middle"" />";
                    }

                    imageUrl.Value        = actInfo.ImageUrl;
                    contentImageUrl.Value = actInfo.ContentImageUrl;
                    endImageUrl.Value     = actInfo.EndImageUrl;

                    cbIsFormRealName.Checked = actInfo.IsFormRealName;
                    tbFormRealNameTitle.Text = actInfo.FormRealNameTitle;
                    cbIsFormMobile.Checked   = actInfo.IsFormMobile;
                    tbFormMobileTitle.Text   = actInfo.FormMobileTitle;
                    cbIsFormEmail.Checked    = actInfo.IsFormEmail;
                    tbFormEmailTitle.Text    = actInfo.FormEmailTitle;
                    cbIsFormAddress.Checked  = actInfo.IsFormAddress;
                    tbFormAddressTitle.Text  = actInfo.FormAddressTitle;
                }
                else
                {
                    dtbEndDate.DateTime = DateTime.Now.AddMonths(1);
                }

                btnReturn.Attributes.Add("onclick",
                                         $@"location.href=""{BackgroundCouponAct.GetRedirectUrl(PublishmentSystemID)}"";return false");
            }
        }