Пример #1
0
        public TaskObject(ITask outer)
        {
            CreatedDateTime = outer.CreatedDateTime;
            Name = outer.Name; 
            Objective = outer.Objective;


            if (outer.Author != null)
            {
                Author = new UserObject(outer.Author);
            }

            if (outer.Manager != null)
            {
                Manager = new UserObject(outer.Manager);
            }


            if (outer.Status != null)
            {
                Status = new TaskStatus(outer.Status);
            }

            if (outer.Priority != null)
            {
                Priority = new TaskPriority(outer.Priority);
            }


            if (outer.ToEmployee != null)
            {
                ToEmployee = new UserObject(outer.ToEmployee);
            }


            StartDateTime = outer.StartDateTime;
            EndDateTime = outer.EndDateTime;

            Description = outer.Description;
            Result = outer.Result;

            if (outer.RootTask != null)
            {
                RootTask = new TaskObject(outer.RootTask);
            }

            if (outer.SubTasks != null)
            {
                SubTasks = outer.SubTasks.Select(x => new TaskObject(x)).ToArray();
            }
        }
Пример #2
0
        public TaskObject()
        {
            StartDateTime = (CreatedDateTime = DateTime.Now).AddDays(1);
            EndDateTime   = StartDateTime.AddDays(7);

            Status   = new TaskStatus();
            Priority = new TaskPriority();
        }