public static bool InsertStorySprint(int projectId, int sprintId, string storyName, int userId) { using (ManagementSystemEntities db = new ManagementSystemEntities()) { if (db.Stories.Where(x => x.Name == storyName).Count() == 0) { Story story = new Story() { CreateDate = DateTime.Now, CreatorId = userId, Name = storyName, ProjectId = projectId }; db.Stories.Add(story); db.SaveChanges(); SprintStory sprintStory = new SprintStory() { SprintId = sprintId, StoryId = story.Id }; db.SprintStories.Add(sprintStory); db.SaveChanges(); return(true); } return(false); } }
public override void SetUp() { sprint = new Sprint(); story = new Story(new Project(), new Gebruiker(), null, StoryType.UserStory); sprintStory = new SprintStory(); base.SetUp(); }
public static void InsertSprintToStory(int storyId, int sprintId) { using (ManagementSystemEntities db = new ManagementSystemEntities()) { SprintStory sprintStory = new SprintStory() { SprintId = sprintId, StoryId = storyId }; db.SprintStories.Add(sprintStory); db.SaveChanges(); } }
public static StoriesDetails InsertNewStory(Story story) { StoriesDetails model = new StoriesDetails(); if (story.Exist) { var q = CheckOfExistingStory(story); if (CheckIfStoryLinkedToSprint(story) == null) { InsertSprintToStory(q.Id, story.sprintId); model = GetStoryDetails(q.Id, story.ProjectId); } } else { if (CheckOfExistingStory(story) != null) { return(model); } else { using (ManagementSystemEntities db = new ManagementSystemEntities()) { db.Stories.Add(story); db.SaveChanges(); int id = db.Stories.OrderByDescending(x => x.Id).First().Id; SprintStory sprint_story = new SprintStory() { SprintId = story.sprintId, StoryId = id }; db.SprintStories.Add(sprint_story); db.SaveChanges(); model = GetStoryDetails(id, story.ProjectId); } } } return(model); }
/// <summary> /// Koppelt de story aan een sprint. /// </summary> /// <param name="sprint">The sprint.</param> /// <param name="story">The story.</param> /// <param name="prioriteit">The prioriteit.</param> public void KoppelStoryAanSprint([ARFetch("sprintId")] Sprint sprint, [ARFetch("storyId")] Story story, Prioriteit prioriteit) { SprintStory sprintStory = new SprintStory(sprint, story, story.Schatting); sprintStory.SprintBacklogPrioriteit = prioriteit; SprintStoryRepository.Save(sprintStory); NameValueCollection args = new NameValueCollection(); args.Add("sprintId", sprint.Id.ToString()); args.Add("prioriteit", prioriteit.ToString()); RedirectToAction("RenderIngeplandeStorieList", args); }
/// <summary> /// Koppelt de story aan een sprint.en geeft vervolgens de korte sprintinfo terug aan de sprintplanning /// </summary> /// <param name="sprint">The sprint.</param> /// <param name="story">The story.</param> public void KoppelStoryAanSprint([ARFetch("sprintId")] Sprint sprint, [ARFetch("storyId")] Story story) { SprintStory sprintStory = new SprintStory(sprint, story, story.Schatting); sprintStory.SprintBacklogPrioriteit = story.ProductBacklogPrioriteit; SprintStoryRepository.Save(sprintStory); PropertyBag.Add("gekozenSprint", sprint); PropertyBag.Add("story", story); RenderView("sprintlogitem", true); }
/// <summary> /// /// </summary> /// <param name="sprintStory"></param> private void RenderSprintStory(SprintStory sprintStory) { //de eerste row bevat de sprintstory this.component.Append("<tr>"); this.component.Append("<td class='story'><span style='font-weight: bold;padding-right: 10px;'>" + sprintStory.Story.Titel + "</span>" + new OpmaakHelper().UrenStatus(sprintStory.Story) + " status: " + sprintStory.Status + "</td>"); //aantal zelf geboekte uren op story per dag this.component.Append("<td class='story" + HighlightVandaag(maandag) + "'> </td>"); this.component.Append("<td class='story" + HighlightVandaag(dinsdag) + "'> </td>"); this.component.Append("<td class='story" + HighlightVandaag(woensdag) + "'> </td>"); this.component.Append("<td class='story" + HighlightVandaag(donderdag) + "'> </td>"); this.component.Append("<td class='story" + HighlightVandaag(vrijdag) + "'> </td>"); this.component.Append("</tr>"); foreach (Task task in sprintStory.Story.Tasks) { RenderTaskRow(task); } }