Ejemplo n.º 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");
		}
Ejemplo n.º 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");
        }
Ejemplo n.º 3
0
 private void deleteWorkTime(Task.WorkTime workTime)
 {
     this.task.DeleteWorkTime(workTime);
     this.populateFields();
 }
Ejemplo n.º 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);
 }