Ejemplo n.º 1
0
        private void FillComboBoxesDe()
        {
            IEnumerable <Map> ieM = Map.GetAll();

            foreach (Map ob in ieM)
            {
                ComboBoxItem cbM = new ComboBoxItem();
                cbM.Content = ob.name;
                cbM.Tag     = ob.id;
                cb_map.Items.Add(cbM);
            }
            if (lastMapIndex >= -1)
            {
                cb_map.SelectedIndex = lastMapIndex;
            }

            IEnumerable <Sex> ieS = Sex.GetAll();

            foreach (Sex ob in ieS)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;
                cbI.Tag     = ob.id;
                cb_Sex.Items.Add(cbI);
            }
            IEnumerable <Fur> ieF = Fur.GetAll();

            foreach (Fur ob in ieF)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;

                cbI.Tag = ob.id;

                cb_Fur.Items.Add(cbI);
                if (ob.id == 1)
                {
                    cb_Fur.SelectedItem = cbI;
                }
            }
            IEnumerable <Difficulty> ieDif = Difficulty.GetAll();

            foreach (Difficulty ob in ieDif)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;
                cbI.Tag     = ob.id;
                cb_Difficulty.Items.Add(cbI);
            }
            IEnumerable <TrophyKind> ieTrK = TrophyKind.GetAll();

            foreach (TrophyKind ob in ieTrK)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;
                cbI.Tag     = ob.id;
                cb_TrophyKind.Items.Add(cbI);
                if (ob.id == 1)
                {
                    cb_TrophyKind.SelectedItem = cbI;
                }
            }
            IEnumerable <TrophyOrgane> ieTrO = TrophyOrgane.GetAll();

            foreach (TrophyOrgane ob in ieTrO)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;
                cbI.Tag     = ob.id;
                cb_TrophyOrgan.Items.Add(cbI);
                if (ob.id == 1)
                {
                    cb_TrophyOrgan.SelectedItem = cbI;
                }
            }
            IEnumerable <Trophy> ieTr = Trophy.GetAll();

            foreach (Trophy ob in ieTr)
            {
                ComboBoxItem cbI = new ComboBoxItem();
                cbI.Content = ob.name;
                cbI.Tag     = ob.id;
                cb_Trophy.Items.Add(cbI);
                if (ob.id == 1)
                {
                    cb_Trophy.SelectedItem = cbI;
                }
            }
        }