Пример #1
0
        public async Task <IActionResult> Create([Bind("FirstName,LastName,JobRole,Id")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Description,Id")] EventType eventType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eventType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventType));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("Name,Address,Id")] School school)
        {
            if (ModelState.IsValid)
            {
                _context.Add(school);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(school));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("EventName,SchoolID,Place,Id")] Event @event)
        {
            if (ModelState.IsValid)
            {
                _context.Add(@event);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(@event));
        }
Пример #5
0
        public async Task <IActionResult> Create([Bind("FirstName,LastName,DoB,Id")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(student));
        }
Пример #6
0
        public async Task <IActionResult> Create([Bind("CompetitionType,LocationName,StartDate,FinishDate,Id")] Competition competition)
        {
            if (ModelState.IsValid)
            {
                _context.Add(competition);
                await _context.SaveChangesAsync();

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