Exemple #1
0
        public Day(StackPanel dayStackPanel, string name, string[] plan, string[] report, byte id)
        {
            _dayStackPanel     = dayStackPanel;
            _id                = id;
            _activitiesManager = ActivitiesManager.GetInstance();

            //Creating all quarters:
            //When some data was taken from database.
            if (plan != null)
            {
                for (byte i = 0; i < 96; i++)
                {
                    Activity plannedActivity  = _activitiesManager.GetActivity(plan[i]);
                    Activity reportedActivity = _activitiesManager.GetActivity(report[i]);
                    _quarters[i] = new Quarter(PrepareQuartersArea(), plannedActivity, reportedActivity, new QuarterIdentifier(_id, i));
                }
            }
            else // When any data wasn't taken from database.
            {
                for (byte i = 0; i < 96; i++)
                {
                    Activity activity = ActivitiesManager.NullActivity;
                    _quarters[i] = new Quarter(PrepareQuartersArea(), activity, activity, new QuarterIdentifier(_id, i));
                }
            }
        }