예제 #1
0
		private void addWorkTime() {
			Task.WorkTime workTime = new Task.WorkTime();
			workTime.StartedAt = this.dateTimePickerFrom.Value;
			workTime.StoppedAt = this.dateTimePickerFrom.Value + (this.dateTimePickerDuration.Value - new DateTime(1970, 1, 1, 0, 0, 0));
			this.task.AddWorkTime(workTime);
			this.populateFields();
			// Find the new task, and select
			int index = this.task.WorkTimes.FindIndex(x => x.StartedAt == workTime.StartedAt && x.StoppedAt == workTime.StoppedAt);
			this.listBoxWorkTimes.SelectedIndex = index;
			this.labelTotalDuration.Text = this.task.Duration.ToString("hh':'mm':'ss");
		}
예제 #2
0
        private void addWorkTime()
        {
            Task.WorkTime workTime = new Task.WorkTime();
            workTime.StartedAt = this.dateTimePickerFrom.Value;
            workTime.StoppedAt = this.dateTimePickerFrom.Value + (this.dateTimePickerDuration.Value - new DateTime(1970, 1, 1, 0, 0, 0));
            this.task.AddWorkTime(workTime);
            this.populateFields();
            // Find the new task, and select
            int index = this.task.WorkTimes.FindIndex(x => x.StartedAt == workTime.StartedAt && x.StoppedAt == workTime.StoppedAt);

            this.listBoxWorkTimes.SelectedIndex = index;
            this.labelTotalDuration.Text        = this.task.Duration.ToString("hh':'mm':'ss");
        }
예제 #3
0
 private void deleteWorkTime(Task.WorkTime workTime)
 {
     this.task.DeleteWorkTime(workTime);
     this.populateFields();
 }
예제 #4
0
 private void populateFromDuration(Task.WorkTime workTime)
 {
     this.dateTimePickerFrom.Value     = workTime.StartedAt;
     this.dateTimePickerDuration.Value = new DateTime(1970, 1, 1, 0, 0, 0) + (workTime.StoppedAt.Value - workTime.StartedAt);
 }