public UserTimesheetDTO GetTimesheetsByUserId(int id) // UserTimesheetDTO { var queryableSheet = QueryableTimesheetByUserID(id); var timesheetDTO = QueryableToDTO(queryableSheet, id); UserTimesheetDTO sentObject = DTOtoDTO(timesheetDTO); return(sentObject); }
// converts TimesheetDTO to UserTimesheetDTO public UserTimesheetDTO DTOtoDTO(TimeSheetDTO firstDTO) { List <string> names = GetNamesToList(firstDTO); UserTimesheetDTO sheet = new UserTimesheetDTO { User_id = firstDTO.User_id, Project_name = names[1], Activity_name = names[0], Customer_name = names[2], Start_time = firstDTO.Start_time, Start_date = firstDTO.Start_date, End_time = firstDTO.End_time, Duration = firstDTO.Duration, Description = firstDTO.Description, Rate = firstDTO.Rate, Exported = firstDTO.Exported, Fixed_rate = firstDTO.Fixed_rate, Hourly_rate = firstDTO.Hourly_rate }; return(sheet); }