/// <summary> /// Initialization of validators. /// </summary> protected void ValidatorInit() { string error = GetString("ScheduleInterval.WrongFormat"); string empty = GetString("ScheduleInterval.ErrorEmpty"); // 'Every' panel validators rfvEvery.ErrorMessage = empty; rvEvery.MinimumValue = QUANTITY_MINIMUM.ToString(); rvEvery.MaximumValue = QUANTITY_MAXIMUM.ToString(); rvEvery.ErrorMessage = error; // 'Between' panel validators rfvFromHours.ErrorMessage = empty; rvFromHours.MinimumValue = HOURS_MINIMUM.ToString(); rvFromHours.MaximumValue = HOURS_MAXIMUM.ToString(); rvFromHours.ErrorMessage = error; rfvFromMinutes.ErrorMessage = empty; rvFromMinutes.MinimumValue = MINUTES_MINIMUM.ToString(); rvFromMinutes.MaximumValue = MINUTES_MAXIMUM.ToString(); rvFromMinutes.ErrorMessage = error; rfvToHours.ErrorMessage = empty; rvToHours.MinimumValue = HOURS_MINIMUM.ToString(); rvToHours.MaximumValue = HOURS_MAXIMUM.ToString(); rvToHours.ErrorMessage = error; rfvToMinutes.ErrorMessage = empty; rvToMinutes.MinimumValue = MINUTES_MINIMUM.ToString(); rvToMinutes.MaximumValue = MINUTES_MAXIMUM.ToString(); rvToMinutes.ErrorMessage = error; rfvInterval.ErrorMessage = String.Format("{0} {1}.", GetString("BasicForm.ErrorInvalidDateTime"), DateTime.Now); }
/// <summary> /// Initializes dialog according to selected period. /// </summary> protected override void OnPeriodChangeInit() { switch (drpPeriod.SelectedValue) { case SchedulingHelper.PERIOD_SECOND: // Second pnlEvery.Visible = true; pnlBetween.Visible = true; pnlDays.Visible = true; pnlMonth.Visible = false; lblEveryPeriod.Text = GetString("ScheduleInterval.Period.second"); break; case SchedulingHelper.PERIOD_MINUTE: // Minute pnlEvery.Visible = true; pnlBetween.Visible = true; pnlDays.Visible = true; pnlMonth.Visible = false; lblEveryPeriod.Text = GetString("ScheduleInterval.Period.Minute"); break; case SchedulingHelper.PERIOD_HOUR: // Hour pnlEvery.Visible = true; pnlBetween.Visible = true; pnlDays.Visible = true; pnlMonth.Visible = false; lblEveryPeriod.Text = GetString("ScheduleInterval.Period.Hour"); break; case SchedulingHelper.PERIOD_DAY: // Day pnlEvery.Visible = true; pnlBetween.Visible = false; pnlDays.Visible = true; pnlMonth.Visible = false; lblEveryPeriod.Text = GetString("ScheduleInterval.Period.Day"); break; case SchedulingHelper.PERIOD_WEEK: // Week pnlEvery.Visible = true; pnlBetween.Visible = false; pnlDays.Visible = false; pnlMonth.Visible = false; lblEveryPeriod.Text = GetString("ScheduleInterval.Period.Week"); break; case SchedulingHelper.PERIOD_YEAR: // Year pnlEvery.Visible = true; pnlBetween.Visible = false; pnlDays.Visible = false; pnlMonth.Visible = false; lblEveryPeriod.Text = GetString("ScheduleInterval.Period.Year"); break; case SchedulingHelper.PERIOD_MONTH: // Month pnlEvery.Visible = false; pnlBetween.Visible = false; pnlDays.Visible = false; pnlMonth.Visible = true; break; case SchedulingHelper.PERIOD_ONCE: // Once pnlEvery.Visible = false; pnlBetween.Visible = false; pnlDays.Visible = false; pnlMonth.Visible = false; break; } // Set default values to text boxes and check-box lists StartTime.SelectedDateTime = DateTime.Now; Quantity.Text = QUANTITY_MINIMUM.ToString(); FromHours.Text = HOURS_MINIMUM.ToString(); FromMinutes.Text = MINUTES_MINIMUM.ToString(); ToHours.Text = HOURS_MAXIMUM.ToString(); ToMinutes.Text = MINUTES_MAXIMUM.ToString(); MonthDate.SelectedIndex = 0; MonthOrder.SelectedIndex = 0; MonthDay.SelectedIndex = 0; }