예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Birthdate,Email")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Username,RealName,CreateDate,Level")] SystemUser systemUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(systemUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(systemUser));
        }
        public async Task <IActionResult> Create([Bind("Id,CountryCode,AreaCode,Number")] Telephone telephone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(telephone);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(telephone));
        }