예제 #1
0
        static public WhatIfResult TryGetNextPeriodic(ProjectItem projectItem, DateTime completedDate)
        {
            if (projectItem.TemplateId == 0)
            {
                return(null);
            }

            var template = projectItem.GetTemplate().Template;

            if (!template.IsPeriodic)
            {
                return(null);
            }

            var activityCreator = new ActivityCreator(projectItem.Project);

            DateTime?newPeriod = UtilityMethods.CalculateNextPeriodicDate(template, projectItem.Deadline);

            if (!newPeriod.HasValue)
            {
                return(null);
            }

            return(activityCreator.CreateFromEvent(projectItem.GetTemplate(), newPeriod.Value));
        }
예제 #2
0
        static public WhatIfResult WhatIfCreatedFromEvent(Activity activityModel,
                                                          Project project,
                                                          DateTime eventDate)
        {
            Assertion.Require(activityModel, "activityModel");
            Assertion.Require(project, "project");

            var handler = new ActivityCreator(project);

            return(handler.CreateFromEvent(activityModel, eventDate));
        }