/* * TimeLogEntry Mapper * */ public List <TimeLogEntry> ToTimeLogEntryList(List <TimeLogEntryModel> entries) { if (entries.Count == 0) { return(null); } var output = new List <TimeLogEntry>(); var t = ToTask(DbManager.GetInstance().Tw.GetRecord(entries.First().TaskId)); foreach (var tm in entries) { var temp = new TimeLogEntry { Id = tm.RowId, InterruptTime = tm.InterruptTime, StartDate = tm.StartDate, Task = t, EndDate = tm.EndDate, LoggedTime = tm.ElapsedTime }; output.Add(temp); } return(output); }
public TimeLogEntryModel ToTimeLogEntryModel(TimeLogEntry entry) { return(new TimeLogEntryModel { RowId = entry.Id, InterruptTime = entry.InterruptTime, StartDate = entry.StartDate, TaskId = entry.Task.Id, EndDate = entry.EndDate, ElapsedTime = entry.LoggedTime }); }