示例#1
0
        public BaseController()
        {
            this.ViewBag.IsUserLogin = true;
            //加载登录信息
            var userInfo = AuthMgr.ReadUserInfo();

            if (userInfo != null)
            {
                //获取登陆账户所在企业

                CurrUser = new CurrentUser()
                {
                    UserName        = userInfo.UserID,
                    UserSysNo       = userInfo.UserSysNo,
                    UserDisplayName = userInfo.UserDisplayName,
                    AvatarImageUrl  = userInfo.AvatarImageUrl,
                    LoginTime       = userInfo.LoginTime.ToString()
                };
                if (userInfo.ExData != null)
                {
                    CurrUser.MasterSysNo = (int)userInfo.ExData;
                    Company company = Service.CompanyService.LoadCompany(CurrUser.MasterSysNo.Value, false);
                    if (company != null && company.SysNo > 0)
                    {
                        CurrUser.AvatarImageUrl = company.Logo;
                    }
                }
                if (userInfo.ExData != null && ((int)userInfo.ExData > 0))
                {
                    ViewBag.IsPMAdmin  = false;
                    CurrUser.IsPMAdmin = false;
                }
                else
                {
                    ViewBag.IsPMAdmin  = true;
                    CurrUser.IsPMAdmin = true;
                }
                this.ViewBag.CurrUser = CurrUser;
            }
        }
        public BaseController()
        {
            this.ViewBag.IsUserLogin = AuthMgr.HasLogin();
            //加载登录信息
            var userInfo = AuthMgr.ReadUserInfo();

            if (userInfo != null)
            {
                CurrUser = new CurrentUser()
                {
                    UserName        = userInfo.UserID,
                    UserSysNo       = userInfo.UserSysNo,
                    UserDisplayName = userInfo.UserDisplayName,
                    AvatarImageUrl  = userInfo.AvatarImageUrl,
                    LoginTime       = userInfo.LoginTime.ToString()
                };
                if (userInfo.ExData != null)
                {
                    CurrUser.MasterSysNo = (int)userInfo.ExData;
                }
                this.ViewBag.CurrUser = CurrUser;
            }
        }