Exemple #1
0
        /// <summary>
        /// Returns whether instance has same settings as input
        /// Compare Mode:
        /// 0=Full settings comparison (include demographics)
        /// 1=Top level settings comparison (exclude demographics)
        /// 2=Demographic settings only
        /// </summary>
        /// <param name="isrSettings"></param>
        /// <param name="compareMode"></param>
        /// <returns></returns>
        public bool IsSame(ISRSettings isrSettings, int compareMode)
        {
            // Compare main settings
            if (compareMode == 0 || compareMode == 1)
            {
                if ((DefaultEfficiencyThreshold != isrSettings.DefaultEfficiencyThreshold) ||
                    (BreakType != isrSettings.BreakType) ||
                    (!DateHelper.IsSame(SelectableDays, isrSettings.SelectableDays)) ||
                    (!DateHelper.IsSame(StartTime, isrSettings.StartTime)) ||
                    (!DateHelper.IsSame(EndTime, isrSettings.EndTime)) ||
                    (ExcludePublicHolidays != isrSettings.ExcludePublicHolidays) ||
                    (ExcludeSchoolHolidays != isrSettings.ExcludeSchoolHolidays))
                {
                    return(false);
                }
            }

            // Compare demographics
            if (compareMode == 0 || compareMode == 2)
            {
                return(ISRDemographicSettings.IsSame(DemographicsSettings, isrSettings.DemographicsSettings));
            }
            return(true);
        }
 private static string Serialize(ISRDemographicSettings demographicSettings)
 {
     return(string.Format("ID={1}{0}ET={2}", (Char)0, demographicSettings.DemographicId, demographicSettings.EfficiencyThreshold));
 }