예제 #1
0
        public async Task <IActionResult> Index(string username)
        {
            var view = await this.userService.GetUserByUsernameAsync <ProfileViewModel>(username);

            var model = new DbDetailUserComplexModel()
            {
                ViewModel = view
            };

            return(this.View(model));
        }
예제 #2
0
        public async Task <IActionResult> Edit(DbDetailUserComplexModel model, string userId, string returnUrl)
        {
            var result = await this.adminUserService.DbUpdateAsync(model.InputModel, userId);

            if (result)
            {
                return(this.Redirect(returnUrl));
            }

            this.ModelState.AddModelError("Error", "Problem happen proceeding your request!");
            return(this.Redirect(returnUrl));
        }