public UsersTask(UsersTask usersTask) { Name = usersTask.Name; LeadTime = usersTask.LeadTime; DateOfCompletion = usersTask.DateOfCompletion; TaskState = usersTask.TaskState; AdditionalInfomatoins = usersTask.AdditionalInfomatoins; }
private void addTaskButton_Click(object sender, EventArgs e) { AddTask addTask = new AddTask(); if (addTask.ShowDialog() == DialogResult.OK) { UsersTask usersTask = addTask.UsersTask; if (!computerManager.TasksDictionary.ContainsKey(usersTask.GetHashCode())) { computerManager.TasksDictionary.Add(usersTask.GetHashCode(), usersTask); taskListBox.DataSource = computerManager.TasksDictionary.Values.ToList(); } else { MessageBox.Show("Task whith the same values has already been added !"); } } }
private void transferButton_Click(object sender, EventArgs e) { UsersTask usersTask = taskListBox.SelectedItem as UsersTask; if (usersTask == null) { return; } if (computerManager.TasksDictionary.Count != 0) { computerManager.TasksDictionary.Remove(usersTask.GetHashCode()); RefreshLists(computerManager.TasksDictionary.Values.ToList()); } Computer computer = pcComboBox.SelectedItem as Computer; if (!(computer is null)) { computer.Tasks.Add(usersTask); }
public EditTask(UsersTask usersTask) : this() { this.usersTask = usersTask; nameTextBox.Text = usersTask.Name; infoTextBox.Text = usersTask.AdditionalInfomatoins; }