Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Balance")] Admin admin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(admin);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(admin));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,UserType,Name,Username,Password,CreateDate")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
        public async Task <IActionResult> Create([Bind("Id,MemberId,Name,AdminId,Amount")] Member member)
        {
            if (ModelState.IsValid)
            {
                _context.Add(member);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AdminId"] = new SelectList(_context.Admins, "Id", "Name", member.AdminId);
            return(View(member));
        }