示例#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)
            {
                ENavigationTypeUtils.AddListItems(DdlNavigationType);

                var menuInfo = DataProviderWx.WebMenuDao.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(DdlNavigationType, menuInfo.NavigationType);
                    TbUrl.Text     = menuInfo.Url;
                    LtlScript.Text = $"<script>{GetFunctionOrChannelOrContentSelectScript(menuInfo)}</script>";
                }

                ddlNavigationType_OnSelectedIndexChanged(null, EventArgs.Empty);

                BtnFunctionSelect.Attributes.Add("onclick", "parent." + ModalFunctionSelect.GetOpenWindowString(PublishmentSystemId, "selectKeyword"));

                BtnContentSelect.Attributes.Add("onclick", "parent." + ModalContentSelect.GetOpenWindowString(PublishmentSystemId, false, "contentSelect"));
                BtnChannelSelect.Attributes.Add("onclick", "parent." + ModalChannelSelect.GetOpenWindowString(PublishmentSystemId));
            }
        }
示例#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)
            {
                ENavigationTypeUtils.AddListItems(ddlNavigationType);

                var menuInfo = DataProviderWX.WebMenuDAO.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(ddlNavigationType, menuInfo.NavigationType);
                    tbUrl.Text     = menuInfo.Url;
                    ltlScript.Text = $"<script>{GetFunctionOrChannelOrContentSelectScript(menuInfo)}</script>";
                }

                ddlNavigationType_OnSelectedIndexChanged(null, EventArgs.Empty);

                btnFunctionSelect.Attributes.Add("onclick", "parent." + Modal.FunctionSelect.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));
            }
        }