Esempio n. 1
0
        override protected void OnInit(EventArgs e)
        {
            if (!Context.User.Identity.IsAuthenticated)
            {
                LogInOutTime("您的登陆凭证已过期,请重新登录", false);
                return;
            }
            var user = WebUtil.GetUser(HttpContext.Current);

            if (user == null)
            {
                LogInOutTime("您的登陆凭证已过期,请重新登录", false);
                return;
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RealName = WebUtil.GetUser(this.Context).RealName;
                var config = new Utility.SiteConfig();
                SocketURL = config.SocketURL;
                var company = WebUtil.GetCompany(this.Context);
                if (company != null)
                {
                    if (company.IsAdmin)
                    {
                        ServerEndTime = "永久";
                    }
                    else
                    {
                        ServerEndTime = company.ServerEndTime > DateTime.MinValue ? company.ServerEndTime.ToString("yyyy年MM月dd日") : "已过期";
                    }
                }
                var      list       = Foresight.DataAccess.SysMenu.GetSysMenuPageCodeList();
                string   GroupName  = Utility.EnumModel.SysMenuGroupNameDefine.appgl.ToString();
                string[] appgl_list = list.Where(p => p.GroupName.Equals(GroupName)).Select(p => p.ModuleCode).ToArray();

                GroupName = Utility.EnumModel.SysMenuGroupNameDefine.jygl.ToString();
                string[] jygl_list = list.Where(p => p.GroupName.Equals(GroupName)).Select(p => p.ModuleCode).ToArray();

                GroupName = Utility.EnumModel.SysMenuGroupNameDefine.jspt.ToString();
                string[] jspt_list = list.Where(p => p.GroupName.Equals(GroupName)).Select(p => p.ModuleCode).ToArray();

                GroupName = Utility.EnumModel.SysMenuGroupNameDefine.sjzx.ToString();
                string[] sjzx_list = list.Where(p => p.GroupName.Equals(GroupName)).Select(p => p.ModuleCode).ToArray();

                GroupName = Utility.EnumModel.SysMenuGroupNameDefine.xtsz.ToString();
                string[] xtsz_list = list.Where(p => p.GroupName.Equals(GroupName)).Select(p => p.ModuleCode).ToArray();
                this.show_appgl = base.CheckAuthByModuleCodeList(appgl_list) ? 1 : 0;
                this.show_jygl  = base.CheckAuthByModuleCodeList(jygl_list) ? 1 : 0;
                this.show_jspt  = base.CheckAuthByModuleCodeList(jspt_list) ? 1 : 0;
                this.show_sjzx  = base.CheckAuthByModuleCodeList(sjzx_list) ? 1 : 0;
                this.show_xtsz  = base.CheckAuthByModuleCodeList(xtsz_list) ? 1 : 0;
            }
        }