public async Task <IActionResult> Edit(int id, [Bind("Id,Staffid,Name,Date,Attendance")] Staffdatas staffdatas) { if (id != staffdatas.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(staffdatas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StaffdatasExists(staffdatas.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(staffdatas)); }
public async Task <IActionResult> Create([Bind("Id,Staffid,Name,Date,Attendance")] Staffdatas staffdatas) { if (ModelState.IsValid) { _context.Add(staffdatas); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(staffdatas)); }