/// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 19, Configuration.FieldSeparator),
                       Id,
                       PrimaryKeyValuePrc?.ToDelimitedString(),
                       FacilityIdPrc != null ? string.Join(Configuration.FieldRepeatSeparator, FacilityIdPrc.Select(x => x.ToDelimitedString())) : null,
                       Department != null ? string.Join(Configuration.FieldRepeatSeparator, Department.Select(x => x.ToDelimitedString())) : null,
                       ValidPatientClasses != null ? string.Join(Configuration.FieldRepeatSeparator, ValidPatientClasses.Select(x => x.ToDelimitedString())) : null,
                       Price != null ? string.Join(Configuration.FieldRepeatSeparator, Price.Select(x => x.ToDelimitedString())) : null,
                       Formula != null ? string.Join(Configuration.FieldRepeatSeparator, Formula) : null,
                       MinimumQuantity.HasValue ? MinimumQuantity.Value.ToString(Consts.NumericFormat, culture) : null,
                       MaximumQuantity.HasValue ? MaximumQuantity.Value.ToString(Consts.NumericFormat, culture) : null,
                       MinimumPrice?.ToDelimitedString(),
                       MaximumPrice?.ToDelimitedString(),
                       EffectiveStartDate.HasValue ? EffectiveStartDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       EffectiveEndDate.HasValue ? EffectiveEndDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       PriceOverrideFlag?.ToDelimitedString(),
                       BillingCategory != null ? string.Join(Configuration.FieldRepeatSeparator, BillingCategory.Select(x => x.ToDelimitedString())) : null,
                       ChargeableFlag,
                       ActiveInactiveFlag,
                       Cost?.ToDelimitedString(),
                       ChargeOnIndicator?.ToDelimitedString()
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Exemple #2
0
        public void Save()
        {
            RegistryKey key;

            if (string.IsNullOrEmpty(Id))
            {
                Id  = GenerateNewId();
                key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\HomeHunter\Shortlists\" + Id);
            }
            else
            {
                key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\HomeHunter\Shortlists\" + Id, true);
            }

            key.SetValue("Name", Name);
            key.SetValue("ExcludeTerms", WebInput.ToRegistryString(ExcludeTerms));
            key.SetValue("IncludeTerms", WebInput.ToRegistryString(IncludeTerms));
            key.SetValue("ExcludePostcodes", WebInput.ToRegistryString(ExcludePostcodes));
            key.SetValue("MinimumPrice", MinimumPrice.ToString()); // Stored as string due to the -1 value.
            key.SetValue("MaximumPrice", MaximumPrice.ToString()); // Stored as string due to the -1 value.
            key.SetValue("AdvertisedOnOrAfter", (int)AdvertisedOnOrAfter);
            key.SetValue("AdvertisedForOrOver", (int)AdvertisedForOrOver);
            key.SetValue("SortOrder", (int)SortOrder);
            key.SetValue("LocationToSortBy", LocationToSortBy);
            key.SetValue("ExcludePriceOnApplication", ExcludePriceOnApplication);
            key.SetValue("ExcludeOffersInvited", ExcludeOffersInvited);
            key.SetValue("ResetIndexAtStart", ResetIndexAtStart);
            key.SetValue("Rightmove42PageLimitFixEnabled", Rightmove42PageLimitFixEnabled);
            key.SetValue("ExcludePropertyUrls", ExcludePropertyUrls);
        }
Exemple #3
0
 public WineListPage SetMaximumPrice(int?price)
 {
     if (price == null)
     {
         return(this);
     }
     MaximumPrice.SetValue(price.ToString());
     return(this);
 }
Exemple #4
0
        public int?GetMaxPrice()
        {
            var stringValue = MaximumPrice.GetValue();

            if (stringValue.IsNullOrEmpty())
            {
                return(null);
            }
            else
            {
                int.TryParse(stringValue, out int result);
                return(result);
            }
        }