/*Function that shows the specific food for a child
         * if the food of the day can not eat it.
         * */
        private void DietSpecificForChild_Load(object sender, EventArgs e)
        {
            this.Text     = "BLIST - " + language["DietA"];
            lbB.Text      = language["Bre"];
            lbL.Text      = language["Lunch"];
            lbS.Text      = language["Snack"];
            btChange.Text = language["Chan"];

            if (breakfast == null && lunch == null && snack == null)
            {
                FoodSelection food = new FoodSelection(listC, listM);
                Child         c    = listC.GetChildOfList(index);
                lbInfoChild.Text = c.GetCod().ToString() + "  :  " + c.GetName() + " " + c.GetSurname();
                tbBreak.Text     = food.SelectFoodForChild(listM.GetBreakfastFood(), index);
                tbLunch.Text     = food.SelectFoodForChild(listM.GetLunchFood(), index);
                tbSnack.Text     = food.SelectFoodForChild(listM.GetSnackFood(), index);
                breakfast        = food.GetBreakfast();
                lunch            = food.GetLunch();
                snack            = food.GetSnack();
            }
            else
            {
                tbBreak.Text = breakfast;
                tbLunch.Text = lunch;
                tbSnack.Text = snack;
            }
        }
Exemple #2
0
        private void Diet_Load(object sender, EventArgs e)
        {
            this.Text     = "BLIST - " + language["Diet"];
            lbB.Text      = language["Bre"];
            lbL.Text      = language["Lunch"];
            lbS.Text      = language["Snack"];
            btChange.Text = language["Chan"];

            if (breakfast == null && lunch == null && snack == null)
            {
                FoodSelection food = new FoodSelection(listC, listM);
                tbBreak.Text = food.GetBreakfast();
                tbLunch.Text = food.GetLunch();
                tbSnack.Text = food.GetSnack();
                breakfast    = food.GetBreakfast();
                lunch        = food.GetLunch();
                snack        = food.GetSnack();
            }
            else
            {
                tbBreak.Text = breakfast;
                tbLunch.Text = lunch;
                tbSnack.Text = snack;
            }
        }
 public ShowChild(int i, ListOfChildren lc, ListOfMeals lm, Dictionary <string, string> d)
 {
     InitializeComponent();
     index        = i;
     listChildren = lc;
     listMeals    = lm;
     meal         = new FoodSelection(lc, lm);
     listOfChild  = list.GetInformationOfAChild(index + 1);
     language     = d;
 }
        private void btChange_Click(object sender, EventArgs e)
        {
            FoodSelection food = new FoodSelection(listC, listM);

            string b = breakfast, l = lunch, s = snack;

            if (cbBreakfast.Checked)
            {
                while (b == breakfast)
                {
                    b = food.SelectFoodForChild(listM.GetBreakfastFood(), index);
                }
                tbBreak.Text = b;
            }

            if (cbLunch.Checked)
            {
                while (l == lunch)
                {
                    l = food.SelectFoodForChild(listM.GetLunchFood(), index);
                }
                tbLunch.Text = l;
            }

            if (cbSnack.Checked)
            {
                while (l == snack)
                {
                    s = food.SelectFoodForChild(listM.GetSnackFood(), index);
                }
                tbSnack.Text = l;
            }

            breakfast = b;
            lunch     = l;
            snack     = s;
        }