Esempio n. 1
0
        private static TaskSummaryResult GetTasksSummary(TaskSummaryArguments args)
        {
            TaskSummaryResult result = new TaskSummaryResult();

            result.SummaryList = TasksSummaries.GetTaskSummary(args.ParentTask, args.FromDate, args.ToDate);
            result.WorkedDays  = TasksSummaries.GetWorkedDays(args.FromDate.Date, args.ToDate.Date);
            return(result);
        }
 public static string GetDescriptionForResult(TaskSummaryResult result)
 {
     switch (result)
     {
         case TaskSummaryResult.Success:
             return "Completed successfully";
         case TaskSummaryResult.AccessDenied:
             return "The credentials you have configured were invalid. Please enter a valid username and password in the Settings page and try again.";
         case TaskSummaryResult.UnreachableServer:
             return "The connection to our server couldn't be established. This would be caused by a temporary network issue. Please try again later.";
         case TaskSummaryResult.UnknownError:
             return "There was an unknown error. Please try again later.";
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
Esempio n. 3
0
        private void UpdateTasksSummary(TaskSummaryResult taskSummaryResult)
        {
            try
            {
                totalTime  = 0;
                workedDays = taskSummaryResult.WorkedDays;
                this.taskList.BeginUpdate();
                this.taskList.Items.Clear();
                foreach (TaskSummary summary in taskSummaryResult.SummaryList)
                {
                    totalTime               += summary.TotalActiveTime;
                    totalTime               += summary.TotalInactiveTime;
                    totalEstimation         += summary.TotalEstimation;
                    totalTimeOverEstimation += summary.TotalTimeOverEstimation;
                    if (summary.IsActive)
                    {
                        totalActiveTime += summary.TotalActiveTime;
                    }

                    TreeListViewItem lvi =
                        new TreeListViewItem(summary.Description,
                                             new string[]
                    {
                        String.Empty,
                        0.ToString("0.0%", CultureInfo.InvariantCulture),
                        String.Empty,
                        0.ToString("0.0%", CultureInfo.InvariantCulture),
                        String.Empty,
                        String.Empty
                    });

                    lvi.ImageIndex = summary.IconId;

                    lvi.Tag = summary;
                    this.taskList.Items.Add(lvi);
                }
                CalculateTasksPercents();
                SetIndicatorsValues();
            }
            finally
            {
                this.taskList.EndUpdate();
                SetReadyState();
            }
        }
Esempio n. 4
0
        private void UpdateTasksSummary(TaskSummaryResult taskSummaryResult)
        {
            try
            {
                totalTime = 0;
                workedDays = taskSummaryResult.WorkedDays;
                this.taskList.BeginUpdate();
                this.taskList.Items.Clear();
                foreach (TaskSummary summary in taskSummaryResult.SummaryList)
                {
                    totalTime += summary.TotalActiveTime;
                    totalTime += summary.TotalInactiveTime;
                    totalEstimation += summary.TotalEstimation;
                    totalTimeOverEstimation += summary.TotalTimeOverEstimation;
                    if (summary.IsActive)
                        totalActiveTime += summary.TotalActiveTime;

                    TreeListViewItem lvi =
                        new TreeListViewItem(summary.Description,
                                             new string[]
                                                {
                                                    String.Empty,
                                                    0.ToString("0.0%", CultureInfo.InvariantCulture),
                                                    String.Empty,
                                                    0.ToString("0.0%", CultureInfo.InvariantCulture),
                                                    String.Empty,
                                                    String.Empty
                                                });

                    lvi.ImageIndex = summary.IconId;

                    lvi.Tag = summary;
                    this.taskList.Items.Add(lvi);
                }
                CalculateTasksPercents();
                SetIndicatorsValues();
            }
            finally
            {
                this.taskList.EndUpdate();
                SetReadyState();
            }
        }
Esempio n. 5
0
 private static TaskSummaryResult GetTasksSummary(TaskSummaryArguments args)
 {
     TaskSummaryResult result = new TaskSummaryResult();
     result.SummaryList = TasksSummaries.GetTaskSummary(args.ParentTask, args.FromDate, args.ToDate);
     result.WorkedDays = TasksSummaries.GetWorkedDays(args.FromDate.Date, args.ToDate.Date);
     return result;
 }