Esempio n. 1
0
        private void ShowChild_Load(object sender, EventArgs e)
        {
            this.Text = "BLIST - " + language["ShowC"];
            Day birth = listChildren.GetChildOfList(index).GetBirthday();
            Day today = new Day();

            lbAge.Text               = language["Age"];
            lbName.Text              = language["Name"];
            lbSurnames.Text          = language["Sur"];
            lbSex.Text               = language["Sex"];
            lbCod.Text               = language["Cod"];
            lbObservations.Text      = language["Obs"];
            lbAllergies.Text         = language["Aller"];
            lbMessageForSchool.Text  = language["MesS"];
            lbMessgeForHome.Text     = language["MesH"];
            lbInfoBeak.Text          = language["IEBr"];
            lbInfLunch.Text          = language["IELu"];
            lbInfSnack.Text          = language["IESn"];
            btDiet.Text              = language["Diet"];
            cbEatBreakAll.Text       = language["All"];
            cbEatBreakHalf.Text      = language["Half"];
            cbEatBreakLittle.Text    = language["Little"];
            cbEatLunchAll.Text       = language["All"];
            cbEatLunchHalf.Text      = language["Half"];
            cbEatLunchLittle.Text    = language["Little"];
            cbEatSnackAll.Text       = language["All"];
            cbEatSnackHalf.Text      = language["Half"];
            cbEatSnackLittle.Text    = language["Little"];
            lbDepositions.Text       = language["Depo"];
            lbDepositionsMor.Text    = language["Morn"];
            lbDepositionsAft.Text    = language["Aft"];
            lbSleepMor.Text          = language["Morn"];
            lbSleepAft.Text          = language["Aft"];
            lbSleep.Text             = language["Sleep"];
            cbDepositionsMorYes.Text = language["Y"];
            cbDepositionsAftYes.Text = language["Y"];
            cbSleepMorGood.Text      = language["Good"];
            cbSleepMorBad.Text       = language["Bad"];
            cbSleepAftGood.Text      = language["Good"];
            cbSleepAftBad.Text       = language["Bad"];
            lbSinceMor.Text          = language["Since"];
            lbSinceAft.Text          = language["Since"];
            lbUntilMor.Text          = language["Until"];
            lbUntilAft.Text          = language["Until"];
            btPrintA.Text            = language["PrintAll"];

            today.day   = time.Day;
            today.month = time.Month;
            today.year  = time.Year;

            foreach (InformationOfDay j in list.GetInformationOfAChild(index + 1))
            {
                cbDaysInformation.Items.Add(j.GetDayForShow());
            }

            tbBirthday.Text     = birth.day + "/" + birth.month + "/" + birth.year;
            tbName.Text         = listChildren.GetChildOfList(index).GetName();
            tbSurnames.Text     = listChildren.GetChildOfList(index).GetSurname();
            tbSex.Text          = listChildren.GetChildOfList(index).GetSex().ToString();
            tbCod.Text          = listChildren.GetChildOfList(index).GetCod().ToString();
            tbObservations.Text =
                listChildren.GetChildOfList(index).GetObservations();
            tbAllergies.Text =
                listChildren.GetChildOfList(index).GetAllergies();
            tbAge.Text     = listChildren.GetChildOfList(index).GetAge().ToString();
            lbTypeAge.Text = listChildren.GetChildOfList(index).GetTypeAge();

            tbFoodBreakfast.Text = meal.GetBreakfast();
            tbFoodLunch.Text     = meal.GetLunch();
            tbFoodSnack.Text     = meal.GetSnack();

            dtpSinceSleepMor.Format       = DateTimePickerFormat.Custom;
            dtpSinceSleepMor.CustomFormat = "HH : mm";
            dtpUntilSleepMor.Format       = DateTimePickerFormat.Custom;
            dtpUntilSleepMor.CustomFormat = "HH : mm";
            dtpSinceSleepAft.Format       = DateTimePickerFormat.Custom;
            dtpSinceSleepAft.CustomFormat = "HH : mm";
            dtpUntilSleepAft.Format       = DateTimePickerFormat.Custom;
            dtpUntilSleepAft.CustomFormat = "HH : mm";
            cbDaysInformation.Text        = time.Day + "/" + time.Month + "/" + time.Year;

            InformationOfDay information = list.GetInformationOfAChildFromDate(
                today, listChildren.GetChildOfList(index).GetCod());

            if (information != null)
            {
                if (information.GetEatAmoutB() == 1)
                {
                    cbEatBreakAll.CheckState = CheckState.Checked;
                }
                else if (information.GetEatAmoutB() == 2)
                {
                    cbEatBreakHalf.CheckState = CheckState.Checked;
                }
                else if (information.GetEatAmoutB() == 3)
                {
                    cbEatBreakLittle.CheckState = CheckState.Checked;
                }

                if (information.GetEatAmoutL() == 1)
                {
                    cbEatLunchAll.CheckState = CheckState.Checked;
                }
                else if (information.GetEatAmoutL() == 2)
                {
                    cbEatLunchHalf.CheckState = CheckState.Checked;
                }
                else if (information.GetEatAmoutL() == 3)
                {
                    cbEatLunchLittle.CheckState = CheckState.Checked;
                }

                if (information.GetEatAmoutS() == 1)
                {
                    cbEatSnackAll.CheckState = CheckState.Checked;
                }
                else if (information.GetEatAmoutS() == 2)
                {
                    cbEatSnackHalf.CheckState = CheckState.Checked;
                }
                else if (information.GetEatAmoutS() == 3)
                {
                    cbEatSnackLittle.CheckState = CheckState.Checked;
                }

                switch (information.GetDepositionsMor())
                {
                case 1:
                    cbDepositionsMorYes.CheckState = CheckState.Checked;
                    break;

                case 2:
                    cbDepositionsMorNo.CheckState = CheckState.Checked;
                    break;

                default:
                    break;
                }

                switch (information.GetDepositionsAft())
                {
                case 1: cbDepositionsAftYes.CheckState = CheckState.Checked;
                    break;

                case 2: cbDepositionsAftNo.CheckState = CheckState.Checked;
                    break;

                default:
                    break;
                }

                switch (information.GetSleepMor())
                {
                case 1:
                    cbSleepMorGood.CheckState = CheckState.Checked;
                    break;

                case 2:
                    cbSleepMorBad.CheckState = CheckState.Checked;
                    break;

                default:
                    break;
                }

                switch (information.GetSleepAft())
                {
                case 1:
                    cbSleepAftGood.CheckState = CheckState.Checked;
                    break;

                case 2:
                    cbSleepAftBad.CheckState = CheckState.Checked;
                    break;

                default:
                    break;
                }


                tbMessageForHome.Text   = information.GetMessageForHome();
                tbMessageForSchool.Text = information.GetMessageForSchool();
            }
        }
        private void HistoricalChild_Load(object sender, EventArgs e)
        {
            string[] mealsArr = infoChild.GetMeal().Split('?');

            lbAge.Text               = language["Age"];
            lbName.Text              = language["Name"];
            lbSurnames.Text          = language["Sur"];
            lbSex.Text               = language["Sex"];
            lbCod.Text               = language["Cod"];
            lbObservations.Text      = language["Obs"];
            lbAllergies.Text         = language["Aller"];
            lbMessageForSchool.Text  = language["MesS"];
            lbMessgeForHome.Text     = language["MesH"];
            lbInfoBeak.Text          = language["IEBr"];
            lbInfLunch.Text          = language["IELu"];
            lbInfSnack.Text          = language["IESn"];
            cbEatBreakAll.Text       = language["All"];
            cbEatBreakHalf.Text      = language["Half"];
            cbEatBreakLittle.Text    = language["Little"];
            cbEatLunchAll.Text       = language["All"];
            cbEatLunchHalf.Text      = language["Half"];
            cbEatLunchLittle.Text    = language["Little"];
            cbEatSnackAll.Text       = language["All"];
            cbEatSnackHalf.Text      = language["Half"];
            cbEatSnackLittle.Text    = language["Little"];
            lbDepositions.Text       = language["Depo"];
            lbDepositionsMor.Text    = language["Morn"];
            lbDepositionsAft.Text    = language["Aft"];
            lbSleepMor.Text          = language["Morn"];
            lbSleepAft.Text          = language["Aft"];
            lbSleep.Text             = language["Sleep"];
            cbDepositionsMorYes.Text = language["Y"];
            cbDepositionsAftYes.Text = language["Y"];
            cbSleepMorGood.Text      = language["Good"];
            cbSleepMorBad.Text       = language["Bad"];
            cbSleepAftGood.Text      = language["Good"];
            cbSleepAftBad.Text       = language["Bad"];
            lbSinceMor.Text          = language["Since"];
            lbSinceAft.Text          = language["Since"];
            lbUntilMor.Text          = language["Until"];
            lbUntilAft.Text          = language["Until"];

            tbSex.Text              = child.GetSex().ToString();
            tbAge.Text              = child.GetAge().ToString();
            tbName.Text             = child.GetName();
            tbSurnames.Text         = child.GetSurname();
            tbCod.Text              = child.GetCod().ToString();
            tbObservations.Text     = child.GetObservations();
            tbAllergies.Text        = child.GetAllergies();
            lbTypeAge.Text          = child.GetTypeAge();
            tbMessageForHome.Text   = infoChild.GetMessageForHome();
            tbMessageForSchool.Text = infoChild.GetMessageForSchool();

            tbFoodBreakfast.Text = mealsArr[0];
            tbFoodLunch.Text     = mealsArr[1];
            tbFoodSnack.Text     = mealsArr[2];

            tbSinceSleepMor.Text =
                infoChild.GetTimeSleepMorSince().hour.ToString("00") + " : " +
                infoChild.GetTimeSleepMorSince().minute.ToString("00");
            tbUntilSleepMor.Text =
                infoChild.GetTimeSleepMorUntil().hour.ToString("00") + " : " +
                infoChild.GetTimeSleepMorUntil().minute.ToString("00");
            tbSinceSleepAft.Text =
                infoChild.GetTimeSleepAftSince().hour.ToString("00") + " : " +
                infoChild.GetTimeSleepAftSince().minute.ToString("00");
            tbUntilSleepAft.Text =
                infoChild.GetTimeSleepAftUntil().hour.ToString("00") + " : " +
                infoChild.GetTimeSleepAftUntil().minute.ToString("00");

            cbDaysInformation.Text = infoChild.GetDay().day + "/" +
                                     infoChild.GetDay().month + "/" + infoChild.GetDay().year;

            if (infoChild.GetEatAmoutB() == 1)
            {
                cbEatBreakAll.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetEatAmoutB() == 2)
            {
                cbEatBreakHalf.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetEatAmoutB() == 3)
            {
                cbEatBreakLittle.CheckState = CheckState.Checked;
            }

            if (infoChild.GetEatAmoutL() == 1)
            {
                cbEatLunchAll.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetEatAmoutL() == 2)
            {
                cbEatLunchHalf.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetEatAmoutL() == 3)
            {
                cbEatLunchLittle.CheckState = CheckState.Checked;
            }

            if (infoChild.GetEatAmoutS() == 1)
            {
                cbEatSnackAll.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetEatAmoutS() == 2)
            {
                cbEatSnackHalf.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetEatAmoutS() == 3)
            {
                cbEatSnackLittle.CheckState = CheckState.Checked;
            }

            if (infoChild.GetDepositionsMor() == 1)
            {
                cbDepositionsMorYes.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetDepositionsMor() == 2)
            {
                cbDepositionsMorNo.CheckState = CheckState.Checked;
            }

            if (infoChild.GetDepositionsAft() == 1)
            {
                cbDepositionsAftYes.CheckState = CheckState.Checked;
            }
            else if (infoChild.GetDepositionsAft() == 2)
            {
                cbDepositionsAftNo.CheckState = CheckState.Checked;
            }
        }