Example #1
0
        /// <summary>
        /// set defaults assuming no parent.
        /// </summary>
        private void SetDefaults()
        {
            this.alreadyCreated = false;
            currentName         = originalName = string.Empty;
            this.enabled        = true;

            this.frequencyType = FrequencyTypes.Weekly;  //SQL2K default value

            this.startDate = DateTime.Now;
            this.startTime = TimeSpan.Zero;

            this.endDate = JobScheduleData.MaxAgentDateValue;
            this.endTime = JobScheduleData.MaxAgentTimeValue;

            this.frequencyInterval = 1; // sunday, SQL2K default value

            this.frequencyRecurranceFactor = 1;

            this.frequencyRelativeInterval = 0;

            this.frequencySubDayInterval = 0;
            this.frequencySubDayTypes    = 0;

            this.id = -1;
        }
Example #2
0
        /// <summary>
        /// setup internal members based upon a JobSchedule object.
        /// </summary>
        /// <param name="source"></param>
        private void LoadData(JobSchedule source)
        {
            currentName         = originalName = source.Name;
            this.urn            = source.Urn;
            this.alreadyCreated = true;

            this.enabled = source.IsEnabled;

            this.frequencyType = source.FrequencyTypes;

            this.startDate = source.ActiveStartDate;
            this.startTime = source.ActiveStartTimeOfDay;
            this.endDate   = source.ActiveEndDate;
            this.endTime   = source.ActiveEndTimeOfDay;

            this.frequencyInterval = source.FrequencyInterval;

            this.frequencyRecurranceFactor = source.FrequencyRecurrenceFactor;
            this.frequencyRelativeInterval = source.FrequencyRelativeIntervals;

            this.frequencySubDayInterval = source.FrequencySubDayInterval;
            this.frequencySubDayTypes    = source.FrequencySubDayTypes;

            // If this JobSchedule object hasn't been Created yet,
            // then accessing the ID will fail.
            try
            {
                this.id = source.ID;
            }
            catch (Microsoft.SqlServer.Management.Smo.PropertyNotSetException)
            {
                this.alreadyCreated = false;
            }
        }
Example #3
0
 /// <summary>
 ///  set default values that the schedule dialog would show
 /// </summary>
 public void SetDefaults()
 {
     this.ActiveEndDate              = ConvertDateTimeToInt(JobScheduleData.MaxAgentDateValue);
     this.ActiveEndTimeOfDay         = EndOfDay;
     this.ActiveStartDate            = ConvertDateTimeToInt(DateTime.Now);
     this.ActiveStartTimeOfDay       = 0;
     this.FrequencyInterval          = 0;
     this.FrequencyRecurrenceFactor  = 1;
     this.frequencyRelativeIntervals = FrequencyRelativeIntervals.First;
     this.FrequencySubDayInterval    = 0;
     this.frequencySubDayTypes       = FrequencySubDayTypes.Unknown;
     this.frequencyTypes             = FrequencyTypes.Weekly;
     this.isEnabled = true;
     this.ID        = -1;
 }