//如果此為修改表格,則應先填入原本資料 private void RefreshData() { if (_presentationModel.IsEdit()) { Task task = _presentationModel.GetTargetTask(); _titleBox.Text = task.Title; _assigneeComboBox.SelectedText = task.Assignee; _priorityComboBox.SelectedIndex = task.Priority; _descriptionTextBox.Text = task.Description; _deadline.Value = Convert.ToDateTime(task.Deadline); } }
public NewTaskForm(PresentationModel presentationModel) { _presentationModel = presentationModel; InitializeComponent(); _assigneeComboBox.Items.Clear(); foreach (string username in _presentationModel.GetProjectUsers()) { _assigneeComboBox.Items.Add(username); } if (_presentationModel.IsEdit()) { Task task = _presentationModel.GetTargetTask(); _titleBox.Text = task.Title; _descriptionTextBox.Text = task.Description; _priorityComboBox.SelectedIndex = task.Priority; _deadline.Value = Convert.ToDateTime(task.Deadline); _assigneeComboBox.Text = task.Assignee; } }
public NewTaskForm(PresentationModel presentationModel) { _presentationModel = presentationModel; InitializeComponent(); _assigneeComboBox.Items.Clear(); foreach (string username in _presentationModel.GetProjectUsers()) { _assigneeComboBox.Items.Add(username); } if (_presentationModel.IsEdit()) { Task task = _presentationModel.GetTargetTask(); _titleBox.Text = task.Title; _descriptionTextBox.Text = task.Description; _priorityComboBox.SelectedIndex = task.Priority; _deadline.Value = Convert.ToDateTime(task.Deadline); _assigneeComboBox.Text = task.Assignee; } }