Пример #1
0
        public dtoCPMactivity(litePmActivity activity)
        {
            Id       = activity.Id;
            IdParent = (activity.Parent != null) ? activity.Parent.Id : 0;
            //Parent = activity.Parent;
            Name                = activity.Name;
            Completeness        = activity.Completeness;
            IsDurationEstimated = activity.IsDurationEstimated;
            DisplayOrder        = activity.DisplayOrder;
            EarlyStart          = activity.EarlyStart;
            EarlyFinish         = activity.EarlyFinish;
            LatestStart         = activity.LatestStart;
            LatestFinish        = activity.LatestFinish;
            EarlyStartDate      = activity.EarlyStartDate;
            EarlyFinishDate     = activity.EarlyFinishDate;
            LatestStartDate     = activity.LatestStartDate;
            LatestFinishDate    = activity.LatestFinishDate;
            Deadline            = activity.Deadline;
            IsSummary           = activity.IsSummary;
            IsVirtual           = activity.IsVirtual;
            Duration            = activity.Duration;

            Predecessors = activity.Predecessors.Where(p => p.Target != null && p.Source != null).Select(p => new dtoCPMlink()
            {
                IdSource = p.Source.Id, IdTarget = p.Target.Id, LeadLag = p.LeadLag, Type = p.Type
            }).ToList();
            Successors = activity.Successors.Where(p => p.Target != null && p.Source != null).Select(p => new dtoCPMlink()
            {
                IdSource = p.Source.Id, IdTarget = p.Target.Id, LeadLag = p.LeadLag, Type = p.Type
            }).ToList();
            IdChildren = (activity.Children == null) ? new List <long>() : activity.Children.Where(c => c.Deleted == BaseStatusDeleted.None).Select(c => c.Id).ToList();
        }
Пример #2
0
 public dtoMapActivity(litePmActivity activity, long rowNumber, Boolean onlyview = false)
 {
     IdActivity       = activity.Id;
     IdParent         = (activity.Parent != null) ? activity.Parent.Id : 0;
     RowNumber        = rowNumber;
     Name             = new dtoField <string>(activity.Name);
     DisplayOrder     = new dtoField <long>(activity.DisplayOrder);
     WBSindex         = activity.WBSindex;
     WBSstring        = activity.WBSstring;
     Depth            = activity.Depth;
     Deadline         = new dtoField <DateTime?>(activity.Deadline);
     IsCompleted      = activity.IsCompleted;
     IsSummary        = activity.IsSummary;
     EarlyStartDate   = new dtoField <DateTime?>(activity.EarlyStartDate);
     EarlyFinishDate  = new dtoField <DateTime?>(activity.EarlyFinishDate);
     LatestStartDate  = activity.LatestStartDate;
     LatestFinishDate = activity.LatestFinishDate;
     isAfterDeadline  = activity.isAfterDeadline;
     isCritical       = activity.isCritical;
     Duration         = new dtoField <dtoDuration>(new dtoDuration(activity.Duration, activity.IsDurationEstimated));
     Links            = new dtoField <List <ParsedActivityLink> >(activity.Predecessors.Where(p => p.Source != null).Select(p => new ParsedActivityLink()
     {
         Id = p.Target.Id, LeadLag = p.LeadLag, LinkType = p.Type
     }).ToList());
     IdLinkedActivities = activity.Predecessors.Where(p => p.Target != null).Select(p => p.Target.Id).ToList();
     Predecessors       = new dtoField <String>();
     IdResources        = new dtoField <List <long> >(activity.CurrentAssignments.Select(a => a.Resource.Id).ToList());
     Resources          = new dtoField <List <dtoResource> >();
     Status             = FieldStatus.none;
     Completeness       = activity.Completeness;
     Permission         = new dtoActivityPermission();
 }
Пример #3
0
 public dtoActivity(litePmActivity activity)
 {
     Id               = activity.Id;
     IdProject        = activity.IdProject;
     IdParent         = (activity.Parent != null) ? activity.Parent.Id : 0;
     Name             = activity.Name;
     Description      = activity.Description;
     Note             = activity.Notes;
     DisplayOrder     = activity.DisplayOrder;
     WBSindex         = activity.WBSindex;
     WBSstring        = activity.WBSstring;
     Depth            = activity.Depth;
     Deadline         = activity.Deadline;
     IsCompleted      = activity.IsCompleted;
     IsSummary        = activity.IsSummary;
     EarlyStartDate   = activity.EarlyStartDate;
     EarlyFinishDate  = activity.EarlyFinishDate;
     LatestStartDate  = activity.LatestStartDate;
     LatestFinishDate = activity.LatestFinishDate;
     isAfterDeadline  = activity.isAfterDeadline;
     isCritical       = activity.isCritical;
     Duration         = new dtoDuration(activity.Duration, activity.IsDurationEstimated);
     Links            = activity.Predecessors.Where(p => p.Target != null).Select(p => new dtoActivityLink()
     {
         Id = p.Id, IdTarget = p.Target.Id, IdSource = Id, LeadLag = p.LeadLag, Type = p.Type
     }).ToList();
     IdResources = activity.CurrentAssignments.Select(a => a.Resource.Id).ToList();
     Assignments = activity.CurrentAssignments.Select(a => new dtoActivityCompletion()
     {
         Id = Id, IdResource = a.Resource.Id, Completeness = a.Completeness, IsApproved = a.IsApproved
     }).ToList();
     Completeness = activity.Completeness;
     Status       = activity.Status;
     Permission   = new dtoActivityPermission();
 }
Пример #4
0
        private void setDtoSettings(liteProjectActivityAssignment assignment, PmActivityPermission permissions, liteResource resource = null)
        {
            litePmActivity task = assignment.Activity;

            Id           = task.Id;
            IdAssignment = assignment.Id;
            ProjectInfo  = new dtoProjectGroupInfo(assignment.Project, permissions, resource);

            Name                = task.Name;
            Description         = task.Description;
            Notes               = task.Notes;
            Completeness        = task.Completeness;
            IsCompleted         = task.IsCompleted;
            Deleted             = task.Deleted;
            Status              = task.Status;
            StartDate           = task.EarlyStartDate;
            EndDate             = task.EarlyFinishDate;
            Deadline            = task.Deadline;
            Duration            = task.Duration;
            IsDurationEstimated = task.IsDurationEstimated;
            IdResources         = task.CurrentAssignments.Select(a => a.Resource.Id).ToList();
            Assignments         = task.CurrentAssignments.Select(a => new dtoActivityCompletion()
            {
                Id = Id, IdResource = a.Resource.Id, Completeness = a.Completeness, IsApproved = a.IsApproved
            }).ToList();

            MyCompleteness         = new dtoField <String>(assignment.Completeness.ToString() + "%");
            MyAssignmentIsApproved = assignment.IsApproved;
        }
Пример #5
0
 public dtoGraphActivity(litePmActivity activity, long rowNumber, Boolean onlyview = false)
 {
     IdActivity   = activity.Id;
     IdParent     = (activity.Parent != null) ? activity.Parent.Id : 0;
     RowNumber    = rowNumber;
     DisplayOrder = activity.DisplayOrder;
     Depth        = activity.Depth;
     IsSummary    = activity.IsSummary;
     Links        = (activity.Predecessors.Where(p => p.Target != null && !p.Target.IsSummary).Select(p => new dtoGraphActivityLink()
     {
         IdPredecessor = p.Target.Id, LeadLag = p.LeadLag, Type = p.Type
     }).ToList());
     //IdLinkedActivities = activity.Predecessors.Where(p => p.Target != null).Select(p => p.Target.Id).ToList();
 }
Пример #6
0
        public litePmActivityLink(litePmActivity source, ParsedActivityLink pal, Dictionary <Int64, litePmActivity> dict)
        {
            try
            {
                Source  = source;
                Target  = dict[pal.Id];
                Type    = pal.LinkType;
                LeadLag = pal.LeadLag;

                Source.Predecessors.Add(this);
                Target.Successors.Add(this);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Пример #7
0
        public litePmActivityLink(litePmActivity source, ParsedActivityLink pal, litePmActivity target)
        {
            try
            {
                Source  = source;
                Target  = target;
                Type    = pal.LinkType;
                LeadLag = pal.LeadLag;

                Source.Predecessors.Add(this);
                Target.Successors.Add(this);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Пример #8
0
 public dtoActivityTreeItem(litePmActivity task, long rowNumber)
 {
     Id              = task.Id;
     IdParent        = (task.Parent != null) ? task.Parent.Id : 0;
     RowNumber       = rowNumber;
     Name            = task.Name;
     DisplayOrder    = task.DisplayOrder;
     WBSindex        = task.WBSindex;
     WBSstring       = task.WBSstring;
     Deadline        = task.Deadline;
     IsSummary       = task.IsSummary;
     EarlyStartDate  = task.EarlyStartDate;
     EarlyFinishDate = task.EarlyFinishDate;
     isCritical      = task.isCritical;
     Duration        = new dtoDuration(task.Duration, task.IsDurationEstimated);
     Links           = task.Predecessors.Where(p => p.Target != null).Select(p => new ParsedActivityLink()
     {
         Id = p.Target.Id, LeadLag = p.LeadLag, LinkType = p.Type
     }).ToList();
     Children = new List <dtoActivityTreeItem>();
     Depth    = task.Depth;
 }