Пример #1
0
        private void FillComboBoxWithData()
        {
            tableController = new TableController();
            if (artistComboBox.Items.Count > 0)
            {
                artistComboBox.Items.Clear();
            }
            artistComboBox.Items.AddRange(
               tableController.GetListByTableName(TableList.Artist).ToArray());


            if (albumComboBox.Items.Count > 0)
            {
                albumComboBox.Items.Clear();
            }
            albumComboBox.Items.AddRange(
               tableController.GetListByTableName(TableList.Album).ToArray());


            if (genreComboBox.Items.Count > 0)
            {
                genreComboBox.Items.Clear();
            }
            genreComboBox.Items.AddRange(
               tableController.GetListByTableName(TableList.Genre).ToArray());

            if (fileNameComboBox.Items.Count > 0)
            {
                fileNameComboBox.Items.Clear();
            }
            fileNameComboBox.Items.AddRange(
                 tableController.GetListByTableName(TableList.FileName).ToArray());
        }
Пример #2
0
        private void FillComboBoxWithData()
        {
            tableController = new TableController();
            if (artistComboBox.Items.Count > 0)
            {
                artistComboBox.Items.Clear();
            }

            foreach (Model.SimpleTable value in tableController.GetListByTableName(TableList.Artist))
            {
                artistComboBox.Items.Add(value.Name);
            }

            if (albumComboBox.Items.Count > 0)
            {
                albumComboBox.Items.Clear();
            }

            foreach (Model.SimpleTable value in tableController.GetListByTableName(TableList.Album))
            {
                albumComboBox.Items.Add(value.Name);
            }

            if (genreComboBox.Items.Count > 0)
            {
                genreComboBox.Items.Clear();
            }

            foreach (Model.SimpleTable value in tableController.GetListByTableName(TableList.Genre))
            {
                genreComboBox.Items.Add(value.Name);
            }

            if (fileNameComboBox.Items.Count > 0)
            {
                fileNameComboBox.Items.Clear();
            }

            foreach (Model.SimpleTable value in tableController.GetListByTableName(TableList.FileName))
            {
                fileNameComboBox.Items.Add(value.Name);
            }

        }