Beispiel #1
0
        //Fill comboboxes. Pass in 'all' to fill all
        private void fillComboBox(string type)
        {
            DatabaseHelper createdb = new DatabaseHelper();

            switch (type)
            {
                case "heads":
                    this.HeadComboBox.DataSource = createdb.selectHeadName();
                    this.HeadComboBox.SelectedItem = null;
                    break;
                case "shells":
                    this.ShellComboBox.DataSource = createdb.selectShellName();
                    this.ShellComboBox.SelectedItem = null;
                    break;
                case "fittings":
                    this.FittingsComboBox.DataSource = createdb.selectFittingName();
                    this.FittingsComboBox.SelectedItem = null;
                    break;
                case "supports":
                    this.SupportsComboBox.DataSource = createdb.selectSupportName();
                    this.SupportsComboBox.SelectedItem = null;
                    break;
                case "internals":
                    this.InternalsComboBox.DataSource = createdb.selectInternalsName();
                    this.InternalsComboBox.SelectedItem = null;
                    break;
                case "interiorPrep":
                    this.InteriorPrepComboBox.DataSource = createdb.selectSurfacePrepInterior();
                    this.InteriorPrepComboBox.SelectedItem = null;
                    break;
                case "exteriorPrep":
                    this.ExteriorPrepComboBox.DataSource = createdb.selectSurfacePrepExterior();
                    this.ExteriorPrepComboBox.SelectedItem = null;
                    break;
                case "exteriorPaint":
                    this.ExteriorPaintComboBox.DataSource = createdb.selectExteriorPaint();
                    this.ExteriorPaintComboBox.SelectedItem = null;
                    break;
                case "interiorPaint":
                    this.InteriorPaintComboBox.DataSource = createdb.selectInteriorPaint();
                    this.InteriorPaintComboBox.SelectedItem = null;
                    break;
                case "all":
                    this.HeadComboBox.DataSource = createdb.selectHeadName();
                    this.ShellComboBox.DataSource = createdb.selectShellName();
                    this.FittingsComboBox.DataSource = createdb.selectFittingName();
                    this.SupportsComboBox.DataSource = createdb.selectSupportName();
                    this.InternalsComboBox.DataSource = createdb.selectInternalsName();
                    this.InteriorPrepComboBox.DataSource = createdb.selectSurfacePrepInterior();
                    this.ExteriorPrepComboBox.DataSource = createdb.selectSurfacePrepExterior();
                    this.ExteriorPaintComboBox.DataSource = createdb.selectExteriorPaint();
                    this.InteriorPaintComboBox.DataSource = createdb.selectInteriorPaint();
                    this.HeadComboBox.SelectedItem = null;
                    this.ShellComboBox.SelectedItem = null;
                    this.FittingsComboBox.SelectedItem = null;
                    this.SupportsComboBox.SelectedItem = null;
                    this.InternalsComboBox.SelectedItem = null;
                    this.InteriorPrepComboBox.SelectedItem = null;
                    this.ExteriorPrepComboBox.SelectedItem = null;
                    this.ExteriorPaintComboBox.SelectedItem = null;
                    this.InteriorPaintComboBox.SelectedItem = null;
                    break;
            }
        }