Ejemplo n.º 1
0
        private void EquipmentChanged()
        {
            int i = comboBox.SelectedIndex;

            comboBox.Items.Clear();
            comboBox.Items.Add("New Equipment");
            LinkedList <string> eqs = controller.GetEquipments();

            foreach (string eq in eqs)
            {
                comboBox.Items.Add(eq);
            }

            comboBox.SelectedIndex = i;
        }
Ejemplo n.º 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;
        }