Пример #1
0
 public Accommodation(int id, MultiLanguage <string> name, MultiLanguage <string> address, MultiLanguage <TextualDescription> description,
                      GeoPoint coordinates, AccommodationStars rating, string checkInTime, string checkOutTime,
                      ContactInfo contactInfo, PropertyTypes type, MultiLanguage <List <string> > amenities, MultiLanguage <string> additionalInfo,
                      OccupancyDefinition occupancyDefinition, int locationId, MultiLanguage <List <string> > leisureAndSports, Status status,
                      RateOptions rateOptions, int?floors, int?buildYear, string postalCode, List <Room> rooms)
 {
     Id                  = id;
     Name                = name;
     Address             = address;
     Description         = description;
     Coordinates         = coordinates;
     Rating              = rating;
     CheckInTime         = checkInTime;
     CheckOutTime        = checkOutTime;
     ContactInfo         = contactInfo;
     Type                = type;
     Amenities           = amenities;
     AdditionalInfo      = additionalInfo;
     OccupancyDefinition = occupancyDefinition;
     LocationId          = locationId;
     RateOptions         = rateOptions;
     Status              = status;
     LeisureAndSports    = leisureAndSports;
     Rooms               = rooms;
     Floors              = floors;
     BuildYear           = buildYear;
     PostalCode          = postalCode;
 }
Пример #2
0
        private void ParseResult(string response, IList <string> includeSpecialServiceCodes = null)
        {
            var document = XElement.Parse(response, LoadOptions.None);

            var rates = from item in document.Descendants("Postage")
                        group item by(string) item.Element("MailService")
                        into g
                        select new { Name            = g.Key,
                                     TotalCharges    = g.Sum(x => decimal.Parse((string)x.Element("Rate"))),
                                     DeliveryDate    = g.Select(x => (string)x.Element("CommitmentDate")).FirstOrDefault(),
                                     SpecialServices = g.Select(x => x.Element("SpecialServices")).FirstOrDefault() };

            foreach (var r in rates)
            {
                //string name = r.Name.Replace(REMOVE_FROM_RATE_NAME, string.Empty);
                var name = Regex.Replace(r.Name, "&lt.*&gt;", "");
                var additionalCharges = 0.0m;

                if (includeSpecialServiceCodes != null && includeSpecialServiceCodes.Count > 0 && r.SpecialServices != null)
                {
                    var specialServices = r.SpecialServices.XPathSelectElements("SpecialService").ToList();
                    if (specialServices.Count > 0)
                    {
                        foreach (var specialService in specialServices)
                        {
                            var serviceId = (string)specialService.Element("ServiceID");
                            var price     = decimal.Parse((string)specialService.Element("Price"));

                            if (includeSpecialServiceCodes.Contains(serviceId.ToString()))
                            {
                                additionalCharges += price;
                            }
                        }
                    }
                }

                if (r.DeliveryDate != null && DateTime.TryParse(r.DeliveryDate, out DateTime deliveryDate))
                {
                    var rateOptions = new RateOptions()
                    {
                        SaturdayDelivery = Shipment.Options.SaturdayDelivery && deliveryDate.DayOfWeek == DayOfWeek.Saturday
                    };
                    AddRate(name, string.Concat("USPS ", name), r.TotalCharges + additionalCharges, deliveryDate, rateOptions, USPSCurrencyCode);
                }
                else
                {
                    AddRate(name, string.Concat("USPS ", name), r.TotalCharges + additionalCharges, DateTime.Now.AddDays(30), null, USPSCurrencyCode);
                }
            }

            //check for errors
            ParseErrors(document);
        }
Пример #3
0
 public void SetRateOptions(RateOptions rateOptions)
 {
     _quote.CompanyName          = rateOptions.CompanyName;
     _quote.EquipmentAmount      = rateOptions.EquipmentAmount;
     _quote.EquipmentDescription = rateOptions.EquipmentDescription;
     _quote.Points      = rateOptions.Points;
     _quote.PassThrough = rateOptions.PassThrough;
     //rate cards that are selected
     _quote.RateCards        = rateOptions.RateCards;
     _quote.Terms            = rateOptions.Terms;
     _quote.MaintenanceTypes = rateOptions.MaintenanceTypes;
     _quote.PurchaseOptions  = rateOptions.PurchaseOptions;
     _quote.AdvancePayments  = rateOptions.AdvancePayments;
 }
Пример #4
0
    // Draw the Rate, Later, and never buttons in the inspector.
    private void DrawRateMe()
    {
        GUI.color = myColor;
        EditorGUILayout.BeginVertical();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        Rect buttonRect = EditorGUILayout.BeginHorizontal();

        buttonRect.x      = buttonRect.width / 3;
        buttonRect.width /= 2;
        buttonRect.height = 30;

        GUI.color = Color.green;
        GUIContent contentRateMe = new GUIContent("Rate Me!", "Haven't you rate Cloudstoy yet? What are you waiting for? Go to the Asset Store to give this amazing asset the stars it deserves!!!");

        if (GUI.Button(buttonRect, contentRateMe))
        {
            //Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/35559"); // CloudsToy /**/
            Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/99415"); // CloudsToy Source

            rateOptions = RateOptions.Rated;
            PlayerPrefs.SetInt("RateOptions", (int)rateOptions);
        }

        GUI.color = myColor;
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();


        buttonRect        = EditorGUILayout.BeginHorizontal();
        buttonRect.x      = buttonRect.width / 4;
        buttonRect.width /= 4;
        buttonRect.height = 20;
        contentRateMe     = new GUIContent("Later", "I will rate CloudsToy later for sure!!  This marvelous asset deverves my inconditional love, I just can't do it right now.");
        if (GUI.Button(buttonRect, contentRateMe))
        {
            rateOptions = RateOptions.Later;
            PlayerPrefs.SetInt("RateOptions", (int)rateOptions);

            dayNumber = System.DateTime.Today.Day;
            PlayerPrefs.SetInt("DayNumber", dayNumber);
        }

        buttonRect.x += buttonRect.width + (buttonRect.width / 2);
        contentRateMe = new GUIContent("Never", "I am an ungrateful guy that love using CloudsToy but I can't spend 5 min of my time rating this little code miracle. (Shame on you!) :(");
        if (GUI.Button(buttonRect, contentRateMe))
        {
            rateOptions = RateOptions.Never;
            PlayerPrefs.SetInt("RateOptions", (int)rateOptions);
        }


        EditorGUILayout.EndHorizontal();
        EditorGUILayout.EndVertical();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
    }
Пример #5
0
    public int dayNumber           = 1;                 // Day number when use clicked onver any rate option.

    public void OnEnable()
    {
        //drawIt = serializedObject.FindProperty ("drawIt");
        maximunClouds = serializedObject.FindProperty("MaximunClouds");
        cloudPreset   = serializedObject.FindProperty("CloudPreset");
        cloudRender   = serializedObject.FindProperty("CloudRender");
        typeClouds    = serializedObject.FindProperty("TypeClouds");
        CloudDetail   = serializedObject.FindProperty("CloudDetail");

        realisticShader   = serializedObject.FindProperty("realisticShader");
        brightShader      = serializedObject.FindProperty("brightShader");
        projectorMaterial = serializedObject.FindProperty("projectorMaterial");

        positionCheckerTime = serializedObject.FindProperty("positionCheckerTime");

        sizeFactorPart = serializedObject.FindProperty("SizeFactorPart");
        emissionMult   = serializedObject.FindProperty("EmissionMult");
        showDebug      = serializedObject.FindProperty("_showDebug");

        softClouds          = serializedObject.FindProperty("SoftClouds");
        spreadDir           = serializedObject.FindProperty("SpreadDir");
        lengthSpread        = serializedObject.FindProperty("LengthSpread");
        numberClouds        = serializedObject.FindProperty("NumberClouds");
        side                = serializedObject.FindProperty("Side");
        dissapearMultiplier = serializedObject.FindProperty("DisappearMultiplier");
        maximunVelocity     = serializedObject.FindProperty("MaximunVelocity");
        velocityMultipier   = serializedObject.FindProperty("VelocityMultipier");
        paintType           = serializedObject.FindProperty("PaintType");
        cloudColor          = serializedObject.FindProperty("CloudColor");
        mainColor           = serializedObject.FindProperty("MainColor");
        secondColor         = serializedObject.FindProperty("SecondColor");
        tintStrength        = serializedObject.FindProperty("TintStrength");
        offset              = serializedObject.FindProperty("offset");
        maxWidthCloud       = serializedObject.FindProperty("MaxWidthCloud");
        maxHeightCloud      = serializedObject.FindProperty("MaxHeightCloud");
        maxDepthCloud       = serializedObject.FindProperty("MaxDepthCloud");
        fixedSize           = serializedObject.FindProperty("FixedSize");
        isAnimate           = serializedObject.FindProperty("IsAnimate");
        animationVelocity   = serializedObject.FindProperty("AnimationVelocity");
        isFadeInOut         = serializedObject.FindProperty("isFadeInOut");
        fadeRatio           = serializedObject.FindProperty("fadeRatio");
        alphaRange          = serializedObject.FindProperty("alphaRange");
        numberOfShadows     = serializedObject.FindProperty("NumberOfShadows");
        cloudsTextAdd       = serializedObject.FindProperty("CloudsTextAdd");
        cloudsTextBlended   = serializedObject.FindProperty("CloudsTextBlended");

        PT1TextureWidth  = serializedObject.FindProperty("PT1TextureWidth");
        PT1TextureHeight = serializedObject.FindProperty("PT1TextureHeight");
        PT1TypeNoise     = serializedObject.FindProperty("PT1TypeNoise");
        PT1Seed          = serializedObject.FindProperty("PT1Seed");
        PT1ScaleWidth    = serializedObject.FindProperty("PT1ScaleWidth");
        PT1ScaleHeight   = serializedObject.FindProperty("PT1ScaleHeight");
        PT1ScaleFactor   = serializedObject.FindProperty("PT1ScaleFactor");

        PT1TurbSize  = serializedObject.FindProperty("PT1TurbSize");
        PT1TurbLacun = serializedObject.FindProperty("PT1TurbLacun");
        PT1TurbGain  = serializedObject.FindProperty("PT1TurbGain");
        PT1turbPower = serializedObject.FindProperty("PT1turbPower");
        PT1xyPeriod  = serializedObject.FindProperty("PT1xyPeriod");

        PT1Lacunarity       = serializedObject.FindProperty("PT1Lacunarity");
        PT1FractalIncrement = serializedObject.FindProperty("PT1FractalIncrement");
        PT1Octaves          = serializedObject.FindProperty("PT1Octaves");
        PT1Offset           = serializedObject.FindProperty("PT1Offset");

        PT1HaloEffect       = serializedObject.FindProperty("PT1HaloEffect");
        PT1HaloInsideRadius = serializedObject.FindProperty("PT1HaloInsideRadius");
        PT1InvertColors     = serializedObject.FindProperty("PT1InvertColors");
        PT1ContrastMult     = serializedObject.FindProperty("PT1ContrastMult");
        PT1UseAlphaTexture  = serializedObject.FindProperty("PT1UseAlphaTexture");
        PT1AlphaIndex       = serializedObject.FindProperty("PT1AlphaIndex");

        rateOptions = (RateOptions)PlayerPrefs.GetInt("RateOptions", 2);
        dayNumber   = PlayerPrefs.GetInt("DayNumber", -1);

        // First Time we use CloudsToy, don't shhow the rate button right now (wait untill tomorrow)
        if (rateOptions == RateOptions.Later && dayNumber == -1)
        {
            dayNumber = System.DateTime.Today.Day; // Get today so the rate button will show tomorrow
        }
        //Debug.Log("CloudsToy Rate Options: " + rateOptions.ToString() + " dayNumber: " + dayNumber);
    }
 protected void AddRate(string providerCode, string name, decimal totalCharges, DateTime delivery, RateOptions options = null)
 {
     AddRate(new Rate(Name, providerCode, name, totalCharges, delivery, options));
 }