Ejemplo n.º 1
0
        public List <TimeLogEntryModel> ToTimeLogEntryModelList(List <TimeLogEntry> entries)
        {
            if (entries.Count == 0)
            {
                return(null);
            }

            var output = new List <TimeLogEntryModel>();

            foreach (var tm in entries)
            {
                var temp = new TimeLogEntryModel
                {
                    RowId         = tm.Id,
                    InterruptTime = tm.InterruptTime,
                    StartDate     = tm.StartDate,
                    TaskId        = tm.Task.Id,
                    EndDate       = tm.EndDate,
                    ElapsedTime   = tm.LoggedTime
                };
                output.Add(temp);
            }

            return(output);
        }
Ejemplo n.º 2
0
 public bool InsertRecord(TimeLogEntryModel timelogentry)
 {
     try
     {
         _db.Insert(timelogentry);
         return(true);
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
         return(false);
     }
 }
Ejemplo n.º 3
0
        public TimeLogEntry ToTimeLogEntry(TimeLogEntryModel entry)
        {
            var t = ToTask(DbManager.GetInstance().Tw.GetRecord(entry.TaskId));

            return(new TimeLogEntry
            {
                Id = entry.RowId,
                InterruptTime = entry.InterruptTime,
                StartDate = entry.StartDate,
                Task = t,
                EndDate = entry.EndDate,
                LoggedTime = entry.ElapsedTime
            });
        }