Beispiel #1
0
 public async Task <IActionResult> Create([Bind("Surname,Name,LastName,Bday,Job,Telephone,IdCity,AddInfo,Id")] EmployeeModel employee)
 {
     if (ModelState.IsValid)
     {
         //_context.Add(employee);
         //await _context.SaveChangesAsync();
         hRService.AddEmployee(employee);
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["IdCity"] = new SelectList(_context.Cities, "Id", "Name", employee.IdCity);
     return(View(employee));
 }