public void StartNewDuty()
        {
            //first we have to pause current ongoing duty
            PauseCurrentDuty();

            Duty duty = new Duty();

            //first timeframe
            DutyTimeFrame ttf = new DutyTimeFrame();
            duty.TimeFrames.Add(ttf);

            duty.Name = string.Format("{0}: {1}", Lang.TaskName_Default, ttf.ToString());

            duty.Status = (int)DutyStatus.Ongoing;

            _Iteration.Duties.Add(duty);
            OngoingDuty = duty;
        }
        private void InitTestStatistics()
        {
            Random rnd = new Random();
            Statistics = new ObservableCollection<DutyWrapper>();

            List<DutyGroup> listGroup = new List<DutyGroup>();
            listGroup.Add(new DutyGroup() { Name = "Programiranje" });
            listGroup.Add(new DutyGroup() { Name = "Support" });
            listGroup.Add(new DutyGroup() { Name = "Testiranje" });
            listGroup.Add(new DutyGroup() { Name = "Dokumentacija" });

            List<DutyWrapper> listDuties = new List<DutyWrapper>();

            for (int i = 0; i < 100; i++)
            {
                Duty dut = new Duty("Task " + i);
                dut.TimeFrames.Clear();
                DutyTimeFrame frame = new DutyTimeFrame();
                frame.From = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 20, 0, 0);
                frame.To = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 21, 0, 0);
                dut.TimeFrames.Add(frame);
                int r = rnd.Next(4);
                dut.Group = listGroup[r];

                int s = rnd.Next(5);
                listDuties.Add(new DutyWrapper() { Duty = dut, Number = s, Display = dut.Group.Name });
                //dut.TotalTimeSpent
            }

            foreach (DutyWrapper dutWrap in listDuties)
            {
                DutyWrapper realWrapper = Statistics.FirstOrDefault(a => a.Display == dutWrap.Duty.Group.Name);

                if (realWrapper != null)
                {
                    realWrapper.Number += dutWrap.Number;
                }
                else
                {
                    Statistics.Add(dutWrap);
                }
            }
        }