Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the view.
        /// </summary>
        /// <param name="dayOfWeek">the current day of the week</param>
        public EditDay(EditDayListener l, bool updatedDay, int dayOfWeek)
        {
            InitializeComponent();
            periodsList.Items.Clear();

            this.l = l;

            // Checks if the day is updated
            if (updatedDay)
            {
                updatedDayPicker.Visible = true;
                this.schedDay = new UpdatedDay(updatedDayPicker.Value);
            }
            else
            {
                updatedDayPicker.Visible = false;
                this.schedDay = new Day(dayOfWeek);
            }

            removePeriodBtn.Enabled = false;

            // Sets the label
            dayOfWeekLbl.Text = Day.intToDay(dayOfWeek);

            this.index = -1;
        }
Ejemplo n.º 2
0
        public EditDay(EditDayListener l, Day day, int i)
            : this(l, day is UpdatedDay, 0)
        {
            this.schedDay = day;

            // Date
            if (day is UpdatedDay) {
                updatedDayPicker.Value = ((UpdatedDay)day).mDate;
            }

            // Periods
            periodsList.Items.Clear();
            foreach (Period p in schedDay.mPeriods)
            {
                periodsList.Items.Add(p);
            }

            // Groups
            refreshGroups();

            this.index = i;
        }