public async Task <IActionResult> Create([Bind("Id,DepartmentName")] Department department) { if (ModelState.IsValid) { _context.Add(department); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(department)); }
public async Task <IActionResult> SignUp(Users users) { if (ModelState.IsValid) { _context.Add(users); await _context.SaveChangesAsync(); return(View()); } return(View(users)); }
public async Task <IActionResult> Create(Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DepartmentId"] = new SelectList(_context.Department, "Id", "Id", employee.DepartmentId); return(View(employee)); }