Esempio n. 1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _keywordId = Body.GetQueryInt("keywordID");

            if (!IsPostBack)
            {
                EMatchTypeUtils.AddListItems(DdlMatchType);

                CbIsEnabled.Checked = true;

                BtnContentSelect.Attributes.Add("onclick", ModalContentSelect.GetOpenWindowString(PublishmentSystemId, false, "contentSelect"));
                BtnChannelSelect.Attributes.Add("onclick", ModalChannelSelect.GetOpenWindowString(PublishmentSystemId, true));

                if (_keywordId > 0)
                {
                    var keywordInfo = DataProviderWx.KeywordDao.GetKeywordInfo(_keywordId);

                    TbKeywords.Text = keywordInfo.Keywords;
                    ControlUtils.SelectListItems(DdlMatchType, EMatchTypeUtils.GetValue(keywordInfo.MatchType));
                    CbIsEnabled.Checked = !keywordInfo.IsDisabled;
                    TbReply.Text        = keywordInfo.Reply;
                }
            }
        }
Esempio n. 2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemId");
            _menuId   = Body.GetQueryInt("menuID");
            _parentId = Body.GetQueryInt("parentID");

            if (!IsPostBack)
            {
                EMenuTypeUtils.AddListItems(DdlMenuType);

                var menuInfo = DataProviderWx.MenuDao.GetMenuInfo(_menuId);
                if (menuInfo == null)
                {
                    _menuId = 0;
                }

                if (_menuId == 0)
                {
                    LtlPageTitle.Text = $"添加{(_parentId == 0 ? "主" : "子")}菜单";
                }
                else
                {
                    LtlPageTitle.Text = $"修改{(_parentId == 0 ? "主" : "子")}菜单({menuInfo.MenuName})";

                    TbMenuName.Text = menuInfo.MenuName;
                    ControlUtils.SelectListItems(DdlMenuType, EMenuTypeUtils.GetValue(menuInfo.MenuType));
                    TbKeyword.Text = menuInfo.Keyword;
                    TbUrl.Text     = menuInfo.Url;
                    LtlScript.Text =
                        $"<script>{MPUtils.GetChannelOrContentSelectScript(PublishmentSystemInfo, menuInfo.ChannelId, menuInfo.ContentId)}</script>";
                }

                DdlMenuType_OnSelectedIndexChanged(null, EventArgs.Empty);

                BtnKeywordSelect.Attributes.Add("onclick", "parent." + ModalKeywordSelect.GetOpenWindowString(PublishmentSystemId, "selectKeyword"));

                BtnContentSelect.Attributes.Add("onclick", "parent." + ModalContentSelect.GetOpenWindowString(PublishmentSystemId, false, "contentSelect"));
                BtnChannelSelect.Attributes.Add("onclick", "parent." + ModalChannelSelect.GetOpenWindowString(PublishmentSystemId));
            }
        }
Esempio n. 3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemId");

            _keywordId  = Body.GetQueryInt("keywordID");
            _resourceId = Body.GetQueryInt("resourceID");
            _floor      = Body.GetQueryInt("floor");
            _isSingle   = TranslateUtils.ToBool(Body.GetQueryString("isSingle"));

            if (!IsPostBack)
            {
                LtlPreview.Text = @"
<p class=""js_cover upload_preview"" style=""display:none"">
    <input type=""hidden"" id=""imageUrl"" name=""imageUrl"" value="""" />
    <img src="""" width=""64"">
    <a class=""js_removeCover"" href=""javascript:;"" onclick=""deleteImageUrl();return false;"">删除</a>
</p>";
                LtlNav.Text     = GetNavHtml(EResourceType.Site);

                LtlSite.Text = @"
<div id=""titles"" class=""well well-small"" style=""display:none""></div>
<input id=""channelID"" name=""channelID"" type=""hidden"" value="""" />
<input id=""contentID"" name=""contentID"" type=""hidden"" value="""" />";

                if (_resourceId > 0)
                {
                    var resourceInfo = DataProviderWx.KeywordResourceDao.GetResourceInfo(_resourceId);

                    if (resourceInfo.ResourceType == EResourceType.Site)
                    {
                        var siteHtml = MPUtils.GetSitePreivewHtml(PublishmentSystemInfo, resourceInfo.ChannelId, resourceInfo.ContentId);
                        if (!string.IsNullOrEmpty(siteHtml))
                        {
                            LtlSite.Text = $@"
<div id=""titles"" class=""well well-small"">{siteHtml}</div>
<input id=""channelID"" name=""channelID"" type=""hidden"" value=""{resourceInfo.ChannelId}"" />
<input id=""contentID"" name=""contentID"" type=""hidden"" value=""{resourceInfo.ContentId}"" />";
                        }
                    }

                    TbTitle.Text = resourceInfo.Title;
                    TbTaxis.Text = resourceInfo.Taxis.ToString();
                    if (!string.IsNullOrEmpty(resourceInfo.ImageUrl))
                    {
                        LtlPreview.Text = $@"
<p class=""js_cover upload_preview"">
    <input type=""hidden"" id=""imageUrl"" name=""imageUrl"" value=""{resourceInfo.ImageUrl}"" />
    <img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" width=""64"">
    <a class=""js_removeCover"" href=""javascript:;"" onclick=""deleteImageUrl();return false;"">删除</a>
</p>";
                    }
                    TbSummary.Text = resourceInfo.Summary;
                    if (resourceInfo.IsShowCoverPic == false)
                    {
                        LtlScript.Text += "<script>$('.js_show_cover_pic').click();</script>";
                    }
                    BreContent.Text      = resourceInfo.Content;
                    TbNavigationUrl.Text = resourceInfo.NavigationUrl;

                    LtlScript.Text +=
                        $@"<script>$('.nav a.{EResourceTypeUtils.GetValue(resourceInfo.ResourceType)}').click();</script>";
                }

                BtnContentSelect.Attributes.Add("onclick", "parent." + ModalContentSelect.GetOpenWindowString(PublishmentSystemId, false, "contentSelect"));
                BtnChannelSelect.Attributes.Add("onclick", "parent." + ModalChannelSelect.GetOpenWindowString(PublishmentSystemId));

                var top = 0;
                if (_floor > 1)
                {
                    top = 67 + (_floor - 1) * 103;
                }
                LtlArrow.Text =
                    $@"<i class=""arrow arrow_out"" style=""margin-top: {top}px;""></i><i class=""arrow arrow_in"" style=""margin-top: {top}px;""></i>";
            }
        }