コード例 #1
0
 /// <summary>
 /// Create a new ScrumDetail object.
 /// </summary>
 /// <param name="scrumDetailId">Initial value of the ScrumDetailId property.</param>
 /// <param name="storyTaskDescription">Initial value of the StoryTaskDescription property.</param>
 /// <param name="assignedTo">Initial value of the AssignedTo property.</param>
 /// <param name="hoursCompleted">Initial value of the HoursCompleted property.</param>
 /// <param name="hoursRemaining">Initial value of the HoursRemaining property.</param>
 /// <param name="scrumId">Initial value of the ScrumId property.</param>
 /// <param name="taskId">Initial value of the TaskId property.</param>
 public static ScrumDetail CreateScrumDetail(global::System.Int32 scrumDetailId, global::System.String storyTaskDescription, global::System.String assignedTo, global::System.Decimal hoursCompleted, global::System.Decimal hoursRemaining, global::System.Int32 scrumId, global::System.Int32 taskId)
 {
     ScrumDetail scrumDetail = new ScrumDetail();
     scrumDetail.ScrumDetailId = scrumDetailId;
     scrumDetail.StoryTaskDescription = storyTaskDescription;
     scrumDetail.AssignedTo = assignedTo;
     scrumDetail.HoursCompleted = hoursCompleted;
     scrumDetail.HoursRemaining = hoursRemaining;
     scrumDetail.ScrumId = scrumId;
     scrumDetail.TaskId = taskId;
     return scrumDetail;
 }
コード例 #2
0
ファイル: ScrumService.cs プロジェクト: corydeppen/ScrumTime
 protected ScrumDetail BuildScrumDetail(Sprint sprint, Task task)
 {
     Scrum mostRecentScrum = GetMostRecentScrum(sprint);
     ScrumDetail mostRecentScrumDetail = null;
     if (mostRecentScrum != null && mostRecentScrum.ScrumDetails.Count() > 0)
     {
         var results = from s in mostRecentScrum.ScrumDetails
                       where s.TaskId == task.TaskId
                       select s;
         if (results.Count() > 0)
             mostRecentScrumDetail = results.First();
     }
     ScrumDetail scrumDetail = new ScrumDetail()
     {
         AssignedTo = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.AssignedTo : AccountMembershipService.UNASSIGNED,
         HoursCompleted = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.HoursCompleted : 0,
         HoursRemaining = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.HoursRemaining :
             ( (task.Hours != null) ? (int)task.Hours : 0 ),
         StoryTaskDescription = task.Story.UserDefinedId + " -> " + task.Description,
         TaskId = task.TaskId
     };
     return scrumDetail;
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ScrumDetails EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToScrumDetails(ScrumDetail scrumDetail)
 {
     base.AddObject("ScrumDetails", scrumDetail);
 }
コード例 #4
0
        public virtual ActionResult Save(FormCollection collection)
        {
            string scrumId = collection.Get("scrumId");
            int scrumIdAsInt = Int32.Parse(scrumId);
            string sprintId = collection.Get("sprintId");
            int sprintIdAsInt = Int32.Parse(sprintId);
            string dateOfScrum = collection.Get("dateOfScrum");
            DateTime dateOfScrumAsDateTime = DateTime.Parse(dateOfScrum);
            string scrumDetailCount = collection.Get("scrumDetailCount");
            int scrumDetailCountAsInt = Int32.Parse(scrumDetailCount);
            Scrum scrum = new Scrum()
            {
                ScrumId = scrumIdAsInt,
                SprintId = sprintIdAsInt,
                DateOfScrum = dateOfScrumAsDateTime,
                ProductId = SessionHelper.GetCurrentProductId(User.Identity.Name, Session)
            };
            for (int i = 0; i < scrumDetailCountAsInt; i++)
            {
                string storyTaskDescription = collection.Get("scrumDetails[" + i + "][StoryTaskDescription]");
                string assignedTo = collection.Get("scrumDetails[" + i + "][AssignedTo]");
                string hoursRemaining = collection.Get("scrumDetails[" + i + "][HoursRemaining]");
                string hoursCompleted = collection.Get("scrumDetails[" + i + "][HoursCompleted]");
                string taskId = collection.Get("scrumDetails[" + i + "][TaskId]");
                ScrumDetail scrumDetail = new ScrumDetail()
                {
                    ScrumId = scrumIdAsInt,
                    AssignedTo = assignedTo,
                    HoursRemaining = decimal.Parse(hoursRemaining),
                    HoursCompleted = decimal.Parse(hoursCompleted),
                    StoryTaskDescription = storyTaskDescription,
                    TaskId = Int32.Parse(taskId)
                };
                scrum.ScrumDetails.Add(scrumDetail);
            }

            scrum = _ScrumService.SaveScrum(scrum);
            return new SecureJsonResult("success");
        }