示例#1
0
        // MARK: - Official Papers
        public async Task <IActionResult> OfficialPaper()
        {
            // 验证是否登陆
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
            }

            var model = new HumanResourceManageModel {
                HumanManages = db.HumanManages
                               .Where(h => h.Email != user.UserName)
                               .ToArray()
            };

            return(View(model));
        }
示例#2
0
        public async Task <IActionResult> HumanResourceManage()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
            }
            var username = user.UserName;

            if (username != "*****@*****.**")
            {
                throw new ApplicationException($"You don't have this power, user {username}.");
            }

            var model = new HumanResourceManageModel
            {
                HumanManages = db.HumanManages.ToArray()
            };

            return(View(model));
        }