Example #1
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));
            }
        }
Example #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");
            menuID   = TranslateUtils.ToInt(GetQueryString("menuID"));
            parentID = TranslateUtils.ToInt(GetQueryString("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." + Modal.KeywordSelect.GetOpenWindowString(PublishmentSystemID, "selectKeyword"));

                btnContentSelect.Attributes.Add("onclick", "parent." + Modal.ContentSelect.GetOpenWindowString(PublishmentSystemID, false, "contentSelect"));
                btnChannelSelect.Attributes.Add("onclick", "parent." + CMS.BackgroundPages.Modal.ChannelSelect.GetOpenWindowString(PublishmentSystemID));
            }
        }