Beispiel #1
0
        private void morningFoodSource_SelectedIndexChanged(object sender, EventArgs e)
        {
            morningDrink.Visible      = false;
            morningDrinkLabel.Visible = false;
            morningSide.Visible       = false;
            morningSideLabel.Visible  = false;
            morningMain.Visible       = false;
            morningMainLabel.Visible  = false;
            if (morningFoodSource.SelectedIndex != 0)
            {
                morningDrink.Items.Clear();
                MorningFoodSource fs = (MorningFoodSource)morningFoodSource.SelectedItem;
                foreach (string drink in fs.drinks)
                {
                    morningDrink.Items.Add(drink);
                }
                if (fs.drinks.ToArray().Length > 0)
                {
                    morningDrink.Visible       = true;
                    morningDrinkLabel.Visible  = true;
                    morningDrink.SelectedIndex = 0;
                }

                morningMain.Items.Clear();
                foreach (MorningMeal meal in fs.meals)
                {
                    morningMain.Items.Add(meal);
                }
                if (fs.meals.ToArray().Length > 0)
                {
                    morningMain.Visible       = true;
                    morningMainLabel.Visible  = true;
                    morningMain.SelectedIndex = 0;

                    morningSide.Items.Clear();
                    MorningMeal m = (MorningMeal)morningMain.SelectedItem;
                    if (m.hasSubtype)
                    {
                        morningSide.Visible      = true;
                        morningSideLabel.Visible = true;
                        morningSideLabel.Text    = m.subtypeName;
                        foreach (string side in m.subtypes)
                        {
                            morningSide.Items.Add(side);
                        }
                        morningSide.SelectedIndex = 0;
                    }
                    else
                    {
                        morningSide.Visible      = false;
                        morningSideLabel.Visible = false;
                    }
                }
            }
        }
Beispiel #2
0
        private void morningMain_SelectedIndexChanged(object sender, EventArgs e)
        {
            morningSide.Items.Clear();
            MorningMeal m = (MorningMeal)morningMain.SelectedItem;

            if (m.hasSubtype)
            {
                morningSide.Visible      = true;
                morningSideLabel.Visible = true;
                morningSideLabel.Text    = m.subtypeName;
                foreach (string side in m.subtypes)
                {
                    morningSide.Items.Add(side);
                }
                morningSide.SelectedIndex = 0;
            }
            else
            {
                morningSide.Visible      = false;
                morningSideLabel.Visible = false;
            }
        }
Beispiel #3
0
 // Constructor
 public MorningBLL() : base(new MorningMeal())
 {
     MorningMeal = new MorningMeal();
 }