public async Task <IActionResult> Edit(Guid id, [Bind("Id,Description,Changes,DateStart,DateEnd")] TableForEmployee tableForEmployee) { if (id != tableForEmployee.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tableForEmployee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TableForEmployeeExists(tableForEmployee.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tableForEmployee)); }
public async Task <IActionResult> Create([Bind("Id,Description,Changes,DateStart,DateEnd")] TableForEmployee tableForEmployee) { if (ModelState.IsValid) { tableForEmployee.Id = Guid.NewGuid(); _context.Add(tableForEmployee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tableForEmployee)); }