コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,EmployeeNumber,FirstName,MiddleName,LastName,Alias,Position,Age,Weight,Height,Nationality,Region,CivilStatus,Birthday,IsDomainUser")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,Title,IRNumber,IncidentDate,ReportedDate,Details,IncidentLocation,Status")] InitialReport initialReport)
        {
            if (ModelState.IsValid)
            {
                _context.Add(initialReport);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(initialReport));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,Name,Address")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

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