Esempio n. 1
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            var model   = new StoryFormModel();
            var story   = StoryRepository.StoryFetch(id);
            var project = ProjectRepository.ProjectFetch(story.ProjectId);

            this.Map(collection, story);

            story = StoryRepository.StorySave(story);

            if (story.IsValid)
            {
                return(this.RedirectToAction("Details", new { id = story.StoryId }));
            }

            model.Title    = "Story Edit";
            model.Story    = story;
            model.Sprints  = SprintRepository.SprintFetchInfoList(project);
            model.Statuses = StatusRepository.StatusFetchInfoList(story.ProjectId);
            model.Users    = ProjectUserRepository.ProjectUserFetchInfoList(story.ProjectId);

            ModelHelper.MapBrokenRules(this.ModelState, story);

            return(this.View(model));
        }
        public ActionResult Details(int id)
        {
            var model   = new ProjectFormModel();
            var project = ProjectRepository.ProjectFetch(id);

            model.Title       = string.Format("Project {0}", project.Name);
            model.Project     = project;
            model.Notes       = NoteRepository.NoteFetchInfoList(id, SourceType.Project);
            model.Attachments = AttachmentRepository.AttachmentFetchInfoList(
                model.Notes.Select(row => row.NoteId).Distinct().ToArray(), SourceType.Note);
            model.Sprints           = SprintRepository.SprintFetchInfoList(project);
            model.Statuses          = StatusRepository.StatusFetchInfoList(id);
            model.Stories           = StoryRepository.StoryFetchInfoList(project, false);
            model.Users             = ProjectUserRepository.ProjectUserFetchInfoList(id);
            model.TimelineListModel = new TimelineListModel
            {
                Timelines    = TimelineRepository.TimelineFetchInfoList(project),
                SourceId     = project.SourceId,
                SourceTypeId = (int)project.SourceType
            };
            model.Actions.Add("Edit this project", Url.Action("Edit", new { id }), "primary");
            model.Actions.Add("Add a story", Url.Action("Create", "Story", new { projectId = id }));
            model.Actions.Add("Add a sprint", Url.Action("Create", "Sprint", new { projectId = id }));
            model.Actions.Add("Add an email", string.Empty);
            model.Actions.Add("Add a note", Url.Action("Create", "Note", new { sourceId = id, sourceTypeId = (int)SourceType.Project }));
            model.Actions.Add("Add a collaborator", Url.Action("Create", "ProjectUser", new { projectId = id }));
            model.Actions.Add("Add a status", Url.Action("Create", "Status", new { projectId = id }));

            return(this.View(model));
        }
Esempio n. 3
0
        public void ProjectUser_Fetch_Info_List()
        {
            ProjectUserTestHelper.ProjectUserAdd();
            ProjectUserTestHelper.ProjectUserAdd();

            var projectUserMembers = ProjectUserRepository.ProjectUserFetchInfoList(new ProjectUserMemberDataCriteria());

            Assert.IsTrue(projectUserMembers.Count() > 1, "Row returned should be greater than one");
        }
        public ActionResult Create(int projectId)
        {
            var model       = new ProjectUserFormModel();
            var projectUser = ProjectUserRepository.ProjectUserNew(projectId, 0);

            model.Title        = "Project User Create";
            model.Users        = UserRepository.UserFetchInfoList();
            model.ProjectUser  = projectUser;
            model.ProjectUsers = ProjectUserRepository.ProjectUserFetchInfoList(projectId);

            return(this.View(model));
        }
Esempio n. 5
0
        public ActionResult Edit(int id)
        {
            var model   = new StoryFormModel();
            var story   = StoryRepository.StoryFetch(id);
            var project = ProjectRepository.ProjectFetch(story.ProjectId);

            model.Title    = "Story Edit";
            model.Story    = story;
            model.Sprints  = SprintRepository.SprintFetchInfoList(project);
            model.Statuses = StatusRepository.StatusFetchInfoList(story.ProjectId);
            model.Users    = ProjectUserRepository.ProjectUserFetchInfoList(story.ProjectId);

            return(this.View(model));
        }
Esempio n. 6
0
        public ActionResult Create(int projectId, int?sprintId)
        {
            var model   = new StoryFormModel();
            var story   = StoryRepository.StoryNew();
            var project = ProjectRepository.ProjectFetch(projectId);

            story.ProjectId = projectId;
            story.SprintId  = sprintId ?? 0;

            model.Title    = "Story Create";
            model.Story    = story;
            model.Sprints  = SprintRepository.SprintFetchInfoList(project);
            model.Statuses = StatusRepository.StatusFetchInfoList(story.ProjectId);
            model.Users    = ProjectUserRepository.ProjectUserFetchInfoList(story.ProjectId);

            return(this.View(model));
        }
        public ActionResult Details(int id)
        {
            var model  = new SprintFormModel();
            var sprint = SprintRepository.SprintFetch(id);

            model.Title       = string.Format("Sprint {0}", sprint.Name);
            model.Sprint      = sprint;
            model.Notes       = NoteRepository.NoteFetchInfoList(id, SourceType.Sprint);
            model.Attachments = AttachmentRepository.AttachmentFetchInfoList(
                model.Notes.Select(row => row.NoteId).Distinct().ToArray(), SourceType.Note);
            model.Statuses = StatusRepository.StatusFetchInfoList(sprint.ProjectId);
            model.Stories  = StoryRepository.StoryFetchInfoList(sprint);
            model.Users    = ProjectUserRepository.ProjectUserFetchInfoList(sprint.ProjectId);
            model.Actions.Add("Edit this sprint", Url.Action("Edit", new { id }), "primary");
            model.Actions.Add("Add a story", Url.Action("Create", "Story", new { projectId = sprint.ProjectId, sprintId = id }));
            model.Actions.Add("Add an email", string.Empty);
            model.Actions.Add("Add a note", Url.Action("Create", "Note", new { sourceId = id, sourceTypeId = (int)SourceType.Sprint }));

            return(this.View(model));
        }