Esempio n. 1
0
        private void DisplaySchedule(DateTime date)
        {
            BunifuCustomLabel targer_S1 = null;
            BunifuCustomLabel target_S2 = null;

            switch (date.DayOfWeek)
            {
            case (DayOfWeek.Monday):
                targer_S1 = bunifuCustomLabel_Mon_S1;
                target_S2 = bunifuCustomLabel_Mon_S2;
                break;

            case (DayOfWeek.Tuesday):
                targer_S1 = bunifuCustomLabel_Tue_S1;
                target_S2 = bunifuCustomLabel_Tue_S2;
                break;

            case (DayOfWeek.Wednesday):
                targer_S1 = bunifuCustomLabel_Wed_S1;
                target_S2 = bunifuCustomLabel_Wed_S2;
                break;

            case (DayOfWeek.Thursday):
                targer_S1 = bunifuCustomLabel_Thu_S1;
                target_S2 = bunifuCustomLabel_Thu_S2;
                break;

            case (DayOfWeek.Friday):
                targer_S1 = bunifuCustomLabel_Fri_S1;
                target_S2 = bunifuCustomLabel_Fri_S2;
                break;

            case (DayOfWeek.Saturday):
                targer_S1 = bunifuCustomLabel_Sat_S1;
                target_S2 = bunifuCustomLabel_Sat_S2;
                break;

            case (DayOfWeek.Sunday):
                targer_S1 = bunifuCustomLabel_Sun_S1;
                target_S2 = bunifuCustomLabel_Sun_S2;
                break;
            }

            if (savedSchedule.GetSchedule(date) == null)
            {
                DailySchedule schedule = manager.GetSchedule(date);
                savedSchedule.AddSchedule(schedule);
                FormatDataInLabel(schedule.GetWorkingShift(1), targer_S1);
                FormatDataInLabel(schedule.GetWorkingShift(2), target_S2);
            }
            else
            {
                FormatDataInLabel(savedSchedule.GetSchedule(date).GetWorkingShift(1), targer_S1);
                FormatDataInLabel(savedSchedule.GetSchedule(date).GetWorkingShift(2), target_S2);
            }
        }