/// <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()));
        }
Beispiel #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);
        }
Beispiel #3
0
 public WineListPage SetMinimumPrice(int?price)
 {
     if (price == null)
     {
         return(this);
     }
     MinimumPrice.SetValue(price.ToString());
     return(this);
 }
Beispiel #4
0
        public int?GetMinPrice()
        {
            var stringValue = MinimumPrice.GetValue();

            if (stringValue.IsNullOrEmpty())
            {
                return(null);
            }
            else
            {
                int.TryParse(stringValue, out int result);
                return(result);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Output all properties
        /// </summary>
        /// <returns>A string</returns>
        public override string ToString()
        {
            var toString = new StringBuilder();

            toString.Append("Id: ").AppendLine(Id);
            toString.Append("Title: ").AppendLine(Title);
            toString.Append("Status: ").AppendLine(Status);
            toString.Append("Type: ").AppendLine(Type);
            toString.Append("Amount: ").AppendLine(Amount.ToString(CultureInfo.InvariantCulture));
            toString.Append("MinimumPrice: ").AppendLine(MinimumPrice.ToString(CultureInfo.InvariantCulture));
            toString.Append("Storewide: ").AppendLine(Storewide.ToString());
            //toString.Append("ApplicableTo: ").AppendLine(ApplicableTo);
            toString.Append("CreatedAt: ").AppendLine(CreatedAt.ToString(CultureInfo.InvariantCulture));
            if (ModifiedAt.HasValue)
            {
                toString.Append("ModifiedAt: ").AppendLine(ModifiedAt.Value.ToString(CultureInfo.InvariantCulture)).AppendLine();
            }
            toString.Append("Currency: ").AppendLine(Currency);
            return(toString.ToString());
        }