Esempio n. 1
0
        public static string GetBathroomsForQuickViewFloorPlans(long?bathroomFromId, long?bathroomToId)
        {
            KeyValuePair <int, string> keyValuePair;
            string value;
            string str;
            List <KeyValuePair <int, string> > bathrooms = ItemTypeBc.Instance.GetBathrooms();

            if (bathroomFromId.HasValue)
            {
                keyValuePair = bathrooms.FirstOrDefault <KeyValuePair <int, string> >((KeyValuePair <int, string> m) => {
                    long key      = (long)m.Key;
                    long?nullable = bathroomFromId;
                    return(key == nullable.GetValueOrDefault() & nullable.HasValue);
                });
                str = keyValuePair.Value;
            }
            else
            {
                str = null;
            }
            if (bathroomToId.HasValue)
            {
                keyValuePair = bathrooms.FirstOrDefault <KeyValuePair <int, string> >((KeyValuePair <int, string> m) => {
                    long key      = (long)m.Key;
                    long?nullable = bathroomToId;
                    return(key == nullable.GetValueOrDefault() & nullable.HasValue);
                });
                value = keyValuePair.Value;
            }
            else
            {
                value = null;
            }
            return(DisplayHelpers.GetRangeForQuickView(str, value));
        }
Esempio n. 2
0
        public static string GetBathroomsForQuickView(long?bathroomFromId, long?bathroomToId)
        {
            List <KeyValuePair <int, string> > bathrooms = ItemTypeBc.Instance.GetBathrooms();
            string result = DisplayHelpers.GetBathroomsForQuickViewFloorPlans(bathroomFromId, bathroomToId);

            if (result != null)
            {
                if (!bathroomFromId.HasValue || !bathroomToId.HasValue)
                {
                    result = ((!bathroomFromId.HasValue || !bathrooms.First <KeyValuePair <int, string> >((KeyValuePair <int, string> b) => {
                        long key = (long)b.Key;
                        long?nullable = bathroomFromId;
                        return(key == nullable.GetValueOrDefault() & nullable.HasValue);
                    }).Value.Equals("1")) && (!bathroomToId.HasValue || !bathrooms.First <KeyValuePair <int, string> >((KeyValuePair <int, string> b) => {
                        long key = (long)b.Key;
                        long?nullable = bathroomToId;
                        return(key == nullable.GetValueOrDefault() & nullable.HasValue);
                    }).Value.Equals("1")) ? string.Format("{0} {1}", result, StaticContent.Lbl_Bathrooms) : string.Format("{0} {1}", result, StaticContent.Lbl_Bathroom));
                }
                else
                {
                    result = string.Format("{0} {1}", result, StaticContent.Lbl_Bathrooms);
                }
            }
            return(result);
        }
Esempio n. 3
0
        public static string GetLivingSpaceForQuickView(MeasureBoundaryVm <int, LivingSpaceMeasure> livingSpace)
        {
            int    value;
            string str;
            string str1;
            string measure = livingSpace.Measure.GetEnumLocalizedValue <LivingSpaceMeasure>();

            if (livingSpace.Min.HasValue)
            {
                value = livingSpace.Min.Value;
                str1  = value.ToString(ConfigurationManager.Instance.NumberFormat);
            }
            else
            {
                str1 = null;
            }
            if (livingSpace.Max.HasValue)
            {
                value = livingSpace.Max.Value;
                str   = value.ToString(ConfigurationManager.Instance.NumberFormat);
            }
            else
            {
                str = null;
            }
            string result = DisplayHelpers.GetRangeForQuickView(str1, str);

            if (result != null)
            {
                result = string.Format("{0} {1}", result, measure);
            }
            return(result);
        }
Esempio n. 4
0
 public static string GetPriceRange(MeasureBoundaryVm <decimal, MoneyType> priceRange)
 {
     return(DisplayHelpers.GetPriceRange(priceRange.ToEntity()));
 }