/// <summary>
 /// Create a new Task object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="projectId">Initial value of the ProjectId property.</param>
 /// <param name="parentId">Initial value of the ParentId property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="duration">Initial value of the Duration property.</param>
 /// <param name="percentComplete">Initial value of the PercentComplete property.</param>
 /// <param name="startDateTime">Initial value of the StartDateTime property.</param>
 /// <param name="endDateTime">Initial value of the EndDateTime property.</param>
 /// <param name="notes">Initial value of the Notes property.</param>
 /// <param name="rowNumber">Initial value of the RowNumber property.</param>
 /// <param name="bindingListIndex">Initial value of the BindingListIndex property.</param>
 /// <param name="completeThrough">Initial value of the CompleteThrough property.</param>
 /// <param name="deadLine">Initial value of the DeadLine property.</param>
 /// <param name="durationResolved">Initial value of the DurationResolved property.</param>
 /// <param name="endDateTimeResolved">Initial value of the EndDateTimeResolved property.</param>
 /// <param name="expanded">Initial value of the Expanded property.</param>
 /// <param name="isRoot">Initial value of the IsRoot property.</param>
 /// <param name="isSumary">Initial value of the IsSumary property.</param>
 /// <param name="taskLevel">Initial value of the TaskLevel property.</param>
 /// <param name="milestone">Initial value of the Milestone property.</param>
 /// <param name="milestoneResolved">Initial value of the MilestoneResolved property.</param>
 public static Task CreateTask(global::System.Int64 id, global::System.Int32 projectId, global::System.Int32 parentId, global::System.String name, global::System.String duration, global::System.Double percentComplete, global::System.DateTime startDateTime, global::System.DateTime endDateTime, global::System.String notes, global::System.Int32 rowNumber, global::System.Int32 bindingListIndex, global::System.DateTime completeThrough, global::System.DateTime deadLine, global::System.String durationResolved, global::System.DateTime endDateTimeResolved, global::System.Boolean expanded, global::System.Boolean isRoot, global::System.Boolean isSumary, global::System.Int32 taskLevel, global::System.Boolean milestone, global::System.Boolean milestoneResolved)
 {
     Task task = new Task();
     task.Id = id;
     task.ProjectId = projectId;
     task.ParentId = parentId;
     task.Name = name;
     task.Duration = duration;
     task.PercentComplete = percentComplete;
     task.StartDateTime = startDateTime;
     task.EndDateTime = endDateTime;
     task.Notes = notes;
     task.RowNumber = rowNumber;
     task.BindingListIndex = bindingListIndex;
     task.CompleteThrough = completeThrough;
     task.DeadLine = deadLine;
     task.DurationResolved = durationResolved;
     task.EndDateTimeResolved = endDateTimeResolved;
     task.Expanded = expanded;
     task.IsRoot = isRoot;
     task.IsSumary = isSumary;
     task.TaskLevel = taskLevel;
     task.Milestone = milestone;
     task.MilestoneResolved = milestoneResolved;
     return task;
 }
Exemple #2
0
        internal static TaskDto Map(Task task)
        {
            TaskDto taskDto = null;
            if (task != null)
            {
                var resourceList = new List<ResourceDto>();
                foreach (var r in task.Resources.ToList())
                {
                    var newResource = Map(r);
                    resourceList.Add(newResource);
                }

                var dependencies = new List<TaskDto>();
                foreach (var t in task.Tasks.ToList())
                {
                    //t.Tasks.Clear();
                    var newTask = Map(t);
                    dependencies.Add(newTask);
                }

                //Olympus._Enterprise.Detach(task);
                taskDto = Mapper.Map<TaskDto>(task);

                taskDto.Resources = resourceList;
                taskDto.Tasks = dependencies;
            }
            return taskDto;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Tasks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTasks(Task task)
 {
     base.AddObject("Tasks", task);
 }
Exemple #4
0
 /// <summary>
 /// Deletes all the resources of one task
 /// </summary>
 /// <param name="task">Task that contains the resources to eliminate</param>
 private static void DeleteAllResources(Task task)
 {
     var delete = task.Resources.ToList();
     foreach (var r in delete)
     {
         Olympus._Enterprise.Resources.DeleteObject(r);
     }
 }