Наследование: ModelBusinessBase
Пример #1
0
        public ActionResult Create(int projectId)
        {
            var model = new SprintFormModel();
            var sprint = SprintRepository.SprintNew(projectId);

            model.Title = "Sprint Create";
            model.Sprint = sprint;

            return this.View(model);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public ActionResult Create(int projectId, FormCollection collection)
        {
            var model = new SprintFormModel();
            var sprint = SprintRepository.SprintNew(projectId);

            this.Map(collection, sprint);

            sprint = SprintRepository.SprintSave(sprint);

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

            model.Title = "Sprint Create";
            model.Sprint = sprint;

            ModelHelper.MapBrokenRules(this.ModelState, sprint);

            return this.View(model);
        }
Пример #4
0
        public ActionResult Edit(int id)
        {
            var model = new SprintFormModel();
            var sprint = SprintRepository.SprintFetch(id);

            model.Title = "Sprint Edit";
            model.Sprint = sprint;

            return this.View(model);
        }