public async Task <bool> EditWorkingDays(int workingDaysId, int workingDays) { var memberWorkingDays = await _manageMemberWorkingDaysService.GetWorkingDaysByIdAsync(workingDaysId); if (memberWorkingDays == null) { return(false); } var newMemberWorkingDays = new MemberWorkingDays { Id = memberWorkingDays.Id, MemberId = memberWorkingDays.MemberId, SprintId = memberWorkingDays.SprintId, WorkingDays = workingDays }; return(await _manageMemberWorkingDaysService.EditMemberWorkingDaysAsync(newMemberWorkingDays)); }
public async Task <bool> EditWorkingDays(int workingDaysId, int workingDays) { var memberWorkingDays = await _manageMemberWorkingDaysService.GetWorkingDaysByIdAsync(workingDaysId); if (memberWorkingDays == null) { return(false); } var newMemberWorkingDays = MemberWorkingDays.Create(memberWorkingDays.Id, memberWorkingDays.MemberId, memberWorkingDays.SprintId, memberWorkingDays.Sprint, workingDays); if (newMemberWorkingDays.WorkingDays >= 0 && newMemberWorkingDays.WorkingDays <= newMemberWorkingDays.Sprint.DaysInSprint) { return(await _manageMemberWorkingDaysService.EditMemberWorkingDaysAsync(newMemberWorkingDays)); } else { return(false); } }