public async Task <IActionResult> UpdateUserShift([FromBody] UpdateUserDto updatedUser) { var newUser = new User { UserId = updatedUser.UserId, AccountId = updatedUser.AccountId, FirstName = updatedUser.FirstName, LastName = updatedUser.LastName, Gender = updatedUser.Gender, DepartmentId = updatedUser.DepartmentId, PositionId = updatedUser.PositionId }; await _userShiftRepo.DeleteAsync(d => d.UserId == updatedUser.UserId); await _userRepo.UpdateAsync(newUser); if (updatedUser.UserShifts.Count > 0) { foreach (var userShift in updatedUser.UserShifts) { var newUserShift = new UserShift { ShiftId = userShift.ShiftId, UserId = userShift.UserId, Day = userShift.Day }; await _userShiftRepo.CreateAsync(newUserShift); } } return(Ok(await GetUserList())); }
public async Task <IActionResult> DeleteLeaveInfo(int id) { return(Ok(await _leaveReqRepo.DeleteAsync(d => d.LeaveRequestId == id))); }
public async Task <IActionResult> DeleteUserInfo(Guid id) { return(Ok(await _userRepo.DeleteAsync(d => d.UserId == id))); }