Пример #1
0
        private void EquipmentAdded()
        {
            MessageBox.Show("Equipment " + textBox_equipment_name.Text + " Added");

            comboBox.Items.Clear();

            comboBox.Items.Add("New Equipment");
            if (controller.HasEquipment())
            {
                LinkedList <string> eqs = controller.GetEquipments();
                foreach (string equipment in eqs)
                {
                    comboBox.Items.Add(equipment);
                }
            }
            comboBox.SelectedIndex = comboBox.Items.Count - 1;
        }
Пример #2
0
        public EquipmentsPage()
        {
            InitializeComponent();

            controller = new EquipmentsController();
            controller.Control();

            textboxes = new LinkedList <TextBox>();
            textboxes.AddLast(textBox_equipment_name);
            textboxes.AddLast(textBox_price);
            textboxes.AddLast(textBox_condition);
            textboxes.AddLast(textBox_warranty_duration);

            comboBox.Items.Add("New Equipment");
            if (controller.HasEquipment())
            {
                LinkedList <string> eqs = controller.GetEquipments();
                foreach (string equipment in eqs)
                {
                    comboBox.Items.Add(equipment);
                }
            }
            comboBox.SelectedIndex = 0;
        }