public void refreshSelection() { this.originalTask = tasks[this.selection.SelectedIndex]; this.name.Text = this.originalTask.name; this.details.Text = this.originalTask.details; this.date.Value = this.originalTask.time.Date; this.time.Value = this.originalTask.time; this.aDate.Value = this.originalTask.alarm.Date; this.aTime.Value = this.originalTask.alarm; }
private void createTask(Object sender, EventArgs args) { DateTime taskTime = date.Value.Date.AddHours(time.Value.Hour).AddMinutes(time.Value.Minute); DateTime alarmTime = aDate.Value.Date.AddHours(aTime.Value.Hour).AddMinutes(aTime.Value.Minute); newTask = Program.getProgram().initializeTask(taskTime); newTask.name = name.Text; newTask.details = details.Text; newTask.time = taskTime; newTask.alarm = alarmTime; this.Close(); this.DialogResult = DialogResult.OK; }
public void editTask(Object sender, EventArgs args) { this.originalTask = tasks[this.selection.SelectedIndex]; DateTime taskTime = date.Value.Date.AddHours(time.Value.Hour).AddMinutes(time.Value.Minute); DateTime alarmTime = aDate.Value.Date.AddHours(aTime.Value.Hour).AddMinutes(aTime.Value.Minute); editedTask = Program.getProgram().initializeTask(taskTime); editedTask.name = name.Text; editedTask.details = details.Text; editedTask.time = taskTime; editedTask.alarm = alarmTime; this.Close(); this.DialogResult = DialogResult.OK; }