/**
  * Method to add a facility to a building
  */
 public void AddFacilityToBuilding(String name)
 {
     facility = new FacilityClass();
     facility.SetName(name);
     facility.GetName();
     facilities.Add(facility);
 }
示例#2
0
        /**
         * Method to assign a task to a student from Building C
         */
        private void assignCTaskButton_Click(object sender, EventArgs e)
        {
            FacilityClass facility = ( FacilityClass )facilityCComboBox.SelectedItem;
            string        hour     = taskTimeCComboBox.SelectedItem.ToString();

            if (buildingCTimeListBox.SelectedIndex != -1)
            {
                foreach (TaskClass task in buildingsC.ToList())
                {
                    if ((task.Time == "Unknown") && (buildingCTimeListBox.SelectedIndex == 0))
                    {
                        task.Time         = hour;
                        task.FacilityName = facility.ToString();
                        buildingCTimeListBox.Items.Clear();
                    }
                }
            }
            else
            {
                MessageBox.Show("Please select a student first!");
            }
        }