Ejemplo n.º 1
0
        private void LoadScheduleDetails()
        {
            //BabyDetails.Visibility = Visibility.Collapsed;
            if (m_storageSettings.TryGetValue<Baby>("babyDetails", out m_babyDetails))
            {
                if (m_babyDetails == null)
                    return;

                //txtMessage.Text = m_babyDetails.BabyName + "'s Recommended Vaccine Schedule:";
                ViewModelScheduler scheduler = new ViewModelScheduler();
                scheduler.LoadSchedule(m_babyDetails);
                string currentMonthName = string.Empty;
                Grid unitGrid = null;
                int nCurrentResultGridTracker = -1;
                int nUnitGridRowTracker = 0;
                foreach (var vaccine in scheduler.VaccineList)
                {
                    if (vaccine.VaccineMonth != currentMonthName)
                    {
                        switch (nCurrentResultGridTracker)
                        {
                            case -1:
                                unitGrid = grid1;
                                schedule1.Text = vaccine.VaccineSchedule;
                                item1.Header = vaccine.VaccineMonth;
                                break;
                            case 0:
                                unitGrid = grid2;
                                schedule2.Text = vaccine.VaccineSchedule;
                                item2.Header = vaccine.VaccineMonth;
                                break;
                            case 1:
                                unitGrid = grid3;
                                schedule3.Text = vaccine.VaccineSchedule;
                                item3.Header = vaccine.VaccineMonth;
                                break;
                            case 2:
                                unitGrid = grid4;
                                schedule4.Text = vaccine.VaccineSchedule;
                                item4.Header = vaccine.VaccineMonth;
                                break;
                            case 3:
                                unitGrid = grid5;
                                schedule5.Text = vaccine.VaccineSchedule;
                                item5.Header = vaccine.VaccineMonth;
                                break;
                            case 4:
                                unitGrid = grid6;
                                schedule6.Text = vaccine.VaccineSchedule;
                                item6.Header = vaccine.VaccineMonth;
                                break;
                            case 5:
                                unitGrid = grid7;
                                schedule7.Text = vaccine.VaccineSchedule;
                                item7.Header = vaccine.VaccineMonth;
                                break;
                            case 6:
                                unitGrid = grid8;
                                schedule8.Text = vaccine.VaccineSchedule;
                                item8.Header = vaccine.VaccineMonth;
                                break;
                            case 7:
                                unitGrid = grid9;
                                schedule9.Text = vaccine.VaccineSchedule;
                                item9.Header = vaccine.VaccineMonth;
                                break;
                            case 8:
                                unitGrid = grid10;
                                schedule10.Text = vaccine.VaccineSchedule;
                                item10.Header = vaccine.VaccineMonth;
                                break;
                            case 9:
                                unitGrid = grid11;
                                schedule11.Text = vaccine.VaccineSchedule;
                                item11.Header = vaccine.VaccineMonth;
                                break;
                            case 10:
                                unitGrid = grid12;
                                schedule12.Text = vaccine.VaccineSchedule;
                                item12.Header = vaccine.VaccineMonth;
                                break;
                            case 11:
                                unitGrid = grid13;
                                schedule13.Text = vaccine.VaccineSchedule;
                                item13.Header = vaccine.VaccineMonth;
                                break;
                            case 12:
                                unitGrid = grid14;
                                schedule14.Text = vaccine.VaccineSchedule;
                                item14.Header = vaccine.VaccineMonth;
                                break;
                        }
                        nUnitGridRowTracker = 0;
                        nCurrentResultGridTracker++;
                        currentMonthName = vaccine.VaccineMonth;
                        AddRecordInResultGrid(vaccine, unitGrid, nUnitGridRowTracker);
                        nUnitGridRowTracker++;
                    }
                    else
                    {
                        AddRecordInResultGrid(vaccine, unitGrid, nUnitGridRowTracker);
                        nUnitGridRowTracker++;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void LoadScheduleDetails()
        {
            //BabyDetails.Visibility = Visibility.Collapsed;
            if (m_storageSettings.TryGetValue <Baby>("babyDetails", out m_babyDetails))
            {
                if (m_babyDetails == null)
                {
                    return;
                }

                //txtMessage.Text = m_babyDetails.BabyName + "'s Recommended Vaccine Schedule:";
                ViewModelScheduler scheduler = new ViewModelScheduler();
                scheduler.LoadSchedule(m_babyDetails);
                string currentMonthName          = string.Empty;
                Grid   unitGrid                  = null;
                int    nCurrentResultGridTracker = -1;
                int    nUnitGridRowTracker       = 0;
                foreach (var vaccine in scheduler.VaccineList)
                {
                    if (vaccine.VaccineMonth != currentMonthName)
                    {
                        switch (nCurrentResultGridTracker)
                        {
                        case -1:
                            unitGrid       = grid1;
                            schedule1.Text = vaccine.VaccineSchedule;
                            item1.Header   = vaccine.VaccineMonth;
                            break;

                        case 0:
                            unitGrid       = grid2;
                            schedule2.Text = vaccine.VaccineSchedule;
                            item2.Header   = vaccine.VaccineMonth;
                            break;

                        case 1:
                            unitGrid       = grid3;
                            schedule3.Text = vaccine.VaccineSchedule;
                            item3.Header   = vaccine.VaccineMonth;
                            break;

                        case 2:
                            unitGrid       = grid4;
                            schedule4.Text = vaccine.VaccineSchedule;
                            item4.Header   = vaccine.VaccineMonth;
                            break;

                        case 3:
                            unitGrid       = grid5;
                            schedule5.Text = vaccine.VaccineSchedule;
                            item5.Header   = vaccine.VaccineMonth;
                            break;

                        case 4:
                            unitGrid       = grid6;
                            schedule6.Text = vaccine.VaccineSchedule;
                            item6.Header   = vaccine.VaccineMonth;
                            break;

                        case 5:
                            unitGrid       = grid7;
                            schedule7.Text = vaccine.VaccineSchedule;
                            item7.Header   = vaccine.VaccineMonth;
                            break;

                        case 6:
                            unitGrid       = grid8;
                            schedule8.Text = vaccine.VaccineSchedule;
                            item8.Header   = vaccine.VaccineMonth;
                            break;

                        case 7:
                            unitGrid       = grid9;
                            schedule9.Text = vaccine.VaccineSchedule;
                            item9.Header   = vaccine.VaccineMonth;
                            break;

                        case 8:
                            unitGrid        = grid10;
                            schedule10.Text = vaccine.VaccineSchedule;
                            item10.Header   = vaccine.VaccineMonth;
                            break;

                        case 9:
                            unitGrid        = grid11;
                            schedule11.Text = vaccine.VaccineSchedule;
                            item11.Header   = vaccine.VaccineMonth;
                            break;

                        case 10:
                            unitGrid        = grid12;
                            schedule12.Text = vaccine.VaccineSchedule;
                            item12.Header   = vaccine.VaccineMonth;
                            break;

                        case 11:
                            unitGrid        = grid13;
                            schedule13.Text = vaccine.VaccineSchedule;
                            item13.Header   = vaccine.VaccineMonth;
                            break;

                        case 12:
                            unitGrid        = grid14;
                            schedule14.Text = vaccine.VaccineSchedule;
                            item14.Header   = vaccine.VaccineMonth;
                            break;
                        }
                        nUnitGridRowTracker = 0;
                        nCurrentResultGridTracker++;
                        currentMonthName = vaccine.VaccineMonth;
                        AddRecordInResultGrid(vaccine, unitGrid, nUnitGridRowTracker);
                        nUnitGridRowTracker++;
                    }
                    else
                    {
                        AddRecordInResultGrid(vaccine, unitGrid, nUnitGridRowTracker);
                        nUnitGridRowTracker++;
                    }
                }
            }
        }