コード例 #1
0
ファイル: frmEditField.cs プロジェクト: BadgerTadger/DSM
        private void EditBreed()
        {
            int selectedBreed = -1;

            cboNewValue       = new ComboBox();
            cboNewValue.Width = panel1.Width;
            panel1.Controls.Add(cboNewValue);
            dog = new Dogs(_connString, new Guid(_dogID));
            DogBreeds        db        = new DogBreeds(_connString);
            List <DogBreeds> breedList = db.GetDog_Breeds();

            foreach (DogBreeds breed in breedList)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Text  = breed.Description;
                item.Value = breed.Dog_Breed_ID;
                cboNewValue.Items.Add(item);
                if (dog.Dog_Breed_ID == breed.Dog_Breed_ID)
                {
                    selectedBreed           = breed.Dog_Breed_ID;
                    lblCurrentValue.Text    = breed.Description;
                    lblCurrentValue.Visible = true;
                }
            }
        }
コード例 #2
0
ファイル: Dogs.aspx.cs プロジェクト: BadgerTadger/DSM
    private void PopulateBreedList()
    {
        DogBreeds        dogBreeds     = new DogBreeds(_connString);
        List <DogBreeds> lkpDog_Breeds = dogBreeds.GetDog_Breeds();

        lstDogBreeds.DataSource = lkpDog_Breeds;
        lstDogBreeds.DataBind();
    }