Exemplo n.º 1
0
        public static Sprint SprintInsert(Sprint sprint)
        {
            sprint = sprint.Save();

            FeedService.FeedAdd("Created", sprint);

            return sprint;
        }
Exemplo n.º 2
0
        public static Sprint SprintFetch(int sprintId)
        {
            var result = Sprint.FetchSprint(
                new SprintDataCriteria
            {
                SprintId = sprintId
            });

            result.Auditor = new SprintAuditor(result.Clone());

            return(result);
        }
Exemplo n.º 3
0
        public static bool SprintDelete(Sprint sprint)
        {
            Sprint.DeleteSprint(
                new SprintCriteria
                    {
                        SprintId = sprint.SprintId
                    });

            FeedService.FeedAdd("Deleted", sprint);

            return true;
        }
Exemplo n.º 4
0
        public static bool SprintDelete(Sprint sprint)
        {
            ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId);

            Sprint.DeleteSprint(
                new SprintDataCriteria
            {
                SprintId = sprint.SprintId
            });

            FeedRepository.FeedAdd(FeedAction.Deleted, sprint);

            return(true);
        }
Exemplo n.º 5
0
        public static Sprint SprintUpdate(Sprint sprint)
        {
            if (!sprint.IsDirty)
            {
                return(sprint);
            }

            sprint = sprint.Save();

            SourceRepository.SourceUpdate(sprint.SprintId, SourceType.Sprint, sprint.Name);

            FeedRepository.FeedAdd(FeedAction.Edited, sprint);

            return(sprint);
        }
Exemplo n.º 6
0
        internal static void FeedAdd(string action, Sprint sprint)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.Sprint, sprint.SprintId);

            if (action == FeedAction.Edited)
            {
                feed.Description = sprint.Auditor.Audit(sprint);
            }
            else
            {
                feed.Description = sprint.Description;
            }

            feed.Sources.Add(SourceType.Project, sprint.ProjectId);

            feed.Save();
        }
Exemplo n.º 7
0
        public static Feed FeedAdd(string action, Sprint sprint)
        {
            var feed = FeedService.FeedNew();

            feed.Type = "Sprint";
            feed.Data = string.Format(
                "Action={0}|SprintId={1}|SprintName={2}|ProjectId={3}|ProjectName={4}|Text=Estimated completed date of {5:d}",
                action,
                sprint.SprintId,
                sprint.Name,
                sprint.ProjectId,
                sprint.ProjectName,
                sprint.EstimatedCompletedDate);

            feed = FeedService.FeedSave(feed);

            return(feed);
        }
Exemplo n.º 8
0
        public static Sprint SprintSave(Sprint sprint)
        {
            if (!sprint.IsValid)
            {
                return sprint;
            }

            Sprint result;

            if (sprint.IsNew)
            {
                result = SprintService.SprintInsert(sprint);
            }
            else
            {
                result = SprintService.SprintUpdate(sprint);
            }

            return result;
        }
Exemplo n.º 9
0
        public static Sprint SprintSave(Sprint sprint)
        {
            if (!sprint.IsValid)
            {
                return(sprint);
            }

            ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId);

            Sprint result;

            if (sprint.IsNew)
            {
                result = SprintRepository.SprintInsert(sprint);
            }
            else
            {
                result = SprintRepository.SprintUpdate(sprint);
            }

            return(result);
        }
Exemplo n.º 10
0
        public static Sprint SprintUpdate(Sprint sprint)
        {
            sprint = sprint.Save();

            FeedService.FeedAdd("Updated", sprint);

            return sprint;
        }
Exemplo n.º 11
0
        public static Sprint SprintNew(int projectId)
        {
            var sprint = Sprint.NewSprint(projectId);

            return(sprint);
        }
Exemplo n.º 12
0
 private void Map(FormCollection source, Sprint destination)
 {
     destination.CompletedDate = DateTime.Parse(source["CompletedDate"]);
     destination.Description = source["Description"];
     destination.IsActive = ModelHelper.ToBoolean(source["IsActive"]);
     destination.IsArchived = ModelHelper.ToBoolean(source["IsArchived"]);
     destination.IsCompleted = ModelHelper.ToBoolean(source["IsCompleted"]);
     destination.EstimatedCompletedDate = DateTime.Parse(source["EstimatedCompletedDate"]);
     destination.EstimatedDuration = int.Parse(source["EstimatedDuration"]);
     destination.Name = source["Name"];
 }