Ejemplo n.º 1
0
 public UsersTask(UsersTask usersTask)
 {
     Name                  = usersTask.Name;
     LeadTime              = usersTask.LeadTime;
     DateOfCompletion      = usersTask.DateOfCompletion;
     TaskState             = usersTask.TaskState;
     AdditionalInfomatoins = usersTask.AdditionalInfomatoins;
 }
Ejemplo n.º 2
0
        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 !");
                }
            }
        }
Ejemplo n.º 3
0
        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);
            }
Ejemplo n.º 4
0
 public EditTask(UsersTask usersTask) : this()
 {
     this.usersTask   = usersTask;
     nameTextBox.Text = usersTask.Name;
     infoTextBox.Text = usersTask.AdditionalInfomatoins;
 }