Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /// <summary>
            /// 菜单BLL
            /// </summary>
            BLLMenuPermission bllMenu = new BLLMenuPermission("");

            /// 权限BLL
            /// </summary>
            BLLPermission.BLLPermission bllPms = new BLLPermission.BLLPermission();
            /// <summary>
            /// 站点BLL
            /// </summary>
            BLLWebSite bllWebSite = new BLLWebSite();

            UserInfo currUser = DataLoadTool.GetCurrUserModel();

            if (currUser == null)
            {
                this.Response.Redirect(ConfigHelper.GetConfigString("logoutUrl"));
                return;
            }
            curUserID      = currUser.UserID;
            websiteOwner   = bllWebSite.WebsiteOwner;
            WebsiteVersion = bllWebSite.GetWebsiteVersion(websiteOwner);
            WebsiteInfo websiteInfo = bllWebSite.GetWebsiteInfo();

            WebsiteLogo = websiteInfo != null ? websiteInfo.WebsiteLogo : "";
            if (string.IsNullOrEmpty(websiteInfo.WebsiteLogo))
            {
                WebsiteLogo = ConfigHelper.GetConfigString("WebsiteLogo");
            }
            ExpirationDate = websiteInfo.WebsiteExpirationDate.HasValue ? websiteInfo.WebsiteExpirationDate.Value.ToString("yyyy-MM-dd") : "";
            //IsValid = websiteInfo.WebsiteExpirationDate.HasValue && websiteInfo.WebsiteExpirationDate.Value.AddDays(1) < DateTime.Now ? false : true;
            WebsiteName = websiteInfo.WebsiteName;
            LogoutHref  = ConfigHelper.GetConfigString("logoutUrl") + "?op=logout";
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /// <summary>
            /// 菜单BLL
            /// </summary>
            BLLMenuPermission bllMenu = new BLLMenuPermission("");

            /// <summary>
            /// 权限BLL
            /// </summary>
            BLLPermission.BLLPermission bllPms = new BLLPermission.BLLPermission();
            /// <summary>
            /// 站点BLL
            /// </summary>
            BLLWebSite bllWebSite = new BLLWebSite();

            UserInfo currUser = DataLoadTool.GetCurrUserModel();

            if (currUser == null)
            {
                this.Response.Redirect(ConfigHelper.GetConfigString("logoutUrl"));
                return;
            }

            websiteInfo = bllWebSite.GetWebsiteInfoModelFromDataBase();

            curUserID    = currUser.UserID;
            websiteOwner = bllWebSite.WebsiteOwner;
            if (bllPms.IsActionPermissionV2(websiteOwner))
            {
                if (currUser.PermissionGroupID.HasValue)
                {
                    ZentCloud.BLLPermission.Model.PermissionGroupInfo perGroupInfo = bllPms.Get <ZentCloud.BLLPermission.Model.PermissionGroupInfo>(string.Format(" GroupID={0}", currUser.PermissionGroupID));
                    if (perGroupInfo != null && perGroupInfo.GroupType == 3)//管理员权限跟站点所有者一致
                    {
                        menuString = bllMenu.GetNewUserMenuTreeHtmlV2(websiteOwner, websiteOwner);
                    }
                    else
                    {
                        menuString = bllMenu.GetNewUserMenuTreeHtmlV2(curUserID, websiteOwner);
                    }
                }
                else
                {
                    menuString = bllMenu.GetNewUserMenuTreeHtmlV2(curUserID, websiteOwner);
                }
            }
            else
            {
                menuString = bllMenu.GetNewUserMenuTreeHtml(curUserID, websiteOwner);
            }
            WebsiteVersion = bllWebSite.GetWebsiteVersion(websiteOwner);

            WebsiteLogo = websiteInfo != null ? websiteInfo.WebsiteLogo : "";
            if (string.IsNullOrEmpty(websiteInfo.WebsiteLogo))
            {
                WebsiteLogo = ConfigHelper.GetConfigString("WebsiteLogo");
            }
            ExpirationDate = websiteInfo.WebsiteExpirationDate.HasValue ? websiteInfo.WebsiteExpirationDate.Value.ToString("yyyy-MM-dd") : "";
            //IsValid = websiteInfo.WebsiteExpirationDate.HasValue && websiteInfo.WebsiteExpirationDate.Value.AddDays(1) < DateTime.Now ? false : true;
            WebsiteName = websiteInfo.WebsiteName;
            LogoutHref  = ConfigHelper.GetConfigString("logoutUrl") + "?op=logout";
        }