示例#1
0
        public async Task <IActionResult> Edit(Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Update(users);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(users));
        }
示例#2
0
        public async Task <IActionResult> Edit(SettUser settUser)
        {
            if (ModelState.IsValid)
            {
                _context.Update(settUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["SettingId"] = new SelectList(_context.DictSettUser, "Id", "Setting", settUser.SettingId);
            ViewData["UserId"]    = new SelectList(_context.Users, "Id", "User", settUser.UserId);
            return(View(settUser));
        }