public static void AddCompareForUpdate(this List<ReminderTask> updateList, ReminderTask appointment)
 {
     if (!updateList.Exists(t => t.TaskId.Equals(appointment.TaskId)))
     {
         updateList.Add(appointment);
     }
 }
예제 #2
0
 public static void CopyDetail(this ReminderTask appointment, ReminderTask otherAppointment)
 {
     appointment.IsDeleted = otherAppointment.IsDeleted;
     appointment.IsCompleted = otherAppointment.IsCompleted;
     appointment.Due = otherAppointment.Due;
     appointment.CompletedOn = otherAppointment.CompletedOn;
     appointment.Title = otherAppointment.Title;
     appointment.Notes = otherAppointment.Notes;
 }
 private bool UpdateTask(TaskItem taskItem, ReminderTask reminderTask)
 {
     try
     {
         taskItem.Subject = reminderTask.Title;
         taskItem.Body = reminderTask.Notes;
         taskItem.DueDate = reminderTask.Due.GetValueOrDefault();
         taskItem.StartDate = reminderTask.StartDate;
         taskItem.Complete = reminderTask.IsCompleted;
         if (reminderTask.IsCompleted)
         {
             taskItem.DateCompleted = reminderTask.CompletedOn.GetValueOrDefault();
         }
         
         taskItem.Status = reminderTask.GetOlTaskStatus();
         taskItem.Save();
         return true;
     } 
     catch (Exception exception)
     {
         Logger.Error(exception);
         return false;
     }
     
 }
 /// <summary>
 /// </summary>
 /// <param name="id"></param>
 /// <param name="taskItem"></param>
 /// <returns>
 /// </returns>
 private ReminderTask GetTaskFromItem(string id, TaskItem taskItem)
 {
     var reminderTask = new ReminderTask(taskItem.EntryID,taskItem.Subject,taskItem.Body, taskItem.DueDate);
     reminderTask.IsCompleted = taskItem.Complete;
     reminderTask.CreatedOn = taskItem.CreationTime;
     reminderTask.UpdatedOn = taskItem.LastModificationTime;
     reminderTask.CompletedOn = taskItem.DateCompleted;
     reminderTask.StartDate = taskItem.StartDate;
     reminderTask.StatusEnum = taskItem.GetTaskStatus();
     return reminderTask;
 }
예제 #5
0
 private ReminderTask CreateReminderTask(Task taskItem)
 {
     var reminderTask = new ReminderTask(taskItem.Id, taskItem.Title, taskItem.Notes,
         taskItem.Due)
     {
         IsDeleted = taskItem.Deleted,
         UpdatedOn = taskItem.Updated,
         CompletedOn = taskItem.Completed,
         IsCompleted = taskItem.Status.Equals("completed")
     };
     return reminderTask;
 }
예제 #6
0
        private Task CreateUpdatedGoogleTask(ReminderTask reminderTask)
        {
            var task = new Task
            {
                Id = reminderTask.TaskId,
                Title = reminderTask.Title,
                Notes = reminderTask.Notes,
                Due = reminderTask.Due,
                Deleted = reminderTask.IsDeleted,
                Status = "needsAction",
                Completed = null,
            };

            if (reminderTask.IsCompleted && reminderTask.CompletedOn != null)
            {                
                task.CompletedRaw = reminderTask.CompletedOn.Value.Rfc339FFormat();
                task.Status = "completed";
            }
            return task;
        }