JelloScrum.Model.Entities.Story.TotalTimeSpent C# (CSharp) Method

TotalTimeSpent() public method

Gets the total amount of time spent on this story.
public TotalTimeSpent ( ) : System.TimeSpan
return System.TimeSpan
        public virtual TimeSpan TotalTimeSpent()
        {
            TimeSpan total = new TimeSpan(0);
            foreach (Task task in tasks)
            {
                total = total.Add(task.TotalTimeSpent());
            }
            return total;
        }

Same methods

Story::TotalTimeSpent ( System.DateTime startDate, System.DateTime endDate ) : System.TimeSpan

Usage Example

Example #1
0
 /// <summary>
 /// Geeft de schatting versus de daadwerkelijke uren als HH:MM / HH:MM
 ///  - Als de daadwerkelijke uren onder de schatting zitten wordt deze groen.
 ///  - Als de daadwerkelijke uren boven de schatting zitten worden deze rood.
 /// </summary>
 /// <param name="schatting">De schatting.</param>
 /// <param name="daadwerkelijk">De daadwerkelijke uren.</param>
 /// <returns>De urenstatus.</returns>
 public string UrenStatus(Story story)
 {
     StringBuilder sb = new StringBuilder();
     sb.AppendFormat("<a href='/tijdregistratie/geeftijdregistratieoverzicht.rails?storyId={0}&width=600' class='jTip' name='Overzicht geboekte uren' id='{1}' style='color: #000000;'>", story.Id, Guid.NewGuid());
     if (story.Estimation > story.TotalTimeSpent())
         sb.AppendFormat("[<span class='statusOk'>{0}</span> / {1}]", Tijd(story.Estimation), Tijd(story.TotalTimeSpent()));
     else
         sb.AppendFormat("[{0} / <span class='statusAlarm'>{1}</span>]", Tijd(story.Estimation), Tijd(story.TotalTimeSpent()));
     sb.Append("</a>");
     return sb.ToString();
 }