Esempio n. 1
0
        public void AddStop(string description, string street, string city, string state, string postalCode, int numberDrops, double latitude, double longitude)
        {
            AllMedStop newStop = new AllMedStop();

            setStopValues(newStop, Guid.NewGuid(), description, street, city, state, postalCode, numberDrops, latitude, longitude);
            this.CurrentlySelectedRouter.Stops.Add(newStop);
        }
Esempio n. 2
0
        public void ShowMap(RoutingMethod routingMethod, bool isRoundTrip, WebControl webControl)
        {
            if (isRoundTrip)
            {
                var origin      = this.CurrentlySelectedRouter.Stops[0];
                var destination = new AllMedStop(
                    origin.Latitude
                    , origin.Longitude
                    , origin.Street
                    , origin.State
                    , origin.City
                    , origin.PostalCode
                    );
                destination.Id          = origin.Id;
                destination.Description = origin.Description;

                this.CurrentlySelectedRouter.Stops.Add(destination);
            }
            this.CurrentlySelectedRouter.Route(routingMethod == RoutingMethod.Optimize, true, webControl);

            if (isRoundTrip)
            {
                this.CurrentlySelectedRouter.Stops.RemoveAt(this.CurrentlySelectedRouter.Stops.Count - 1);
            }
        }
Esempio n. 3
0
 private void setStopValues(AllMedStop stop, Guid id, string description, string street, string city, string state, string postalCode, int numberDrops, double latitude, double longitude)
 {
     stop.Id          = id;
     stop.Description = description;
     stop.Street      = street;
     stop.City        = city;
     stop.State       = state;
     stop.PostalCode  = postalCode;
     stop.NumberDrops = numberDrops;
     stop.Latitude    = latitude;
     stop.Longitude   = longitude;
 }
Esempio n. 4
0
        void routeView_OnEditStop(object sender, GuidEventArgs e)
        {
            AllMedStop stop = _model.CurrentlySelectedRouter.GetDeliveryPoint(e.Value);

            _stopView.PopulateStop(
                stop.Id
                , stop.Description
                , stop.Street
                , stop.City
                , stop.State
                , stop.PostalCode
                , stop.Latitude
                , stop.Longitude
                );
            _stopView.Launch(false);
        }
Esempio n. 5
0
        private void setMockDataWithoutGeocodes()
        {
            var origin = new AllMedStop(0, 0, "1722 Colquitt St.", "Houston", "TX", "77098");

            origin.Description = "House";
            var wayPoint1 = new AllMedStop(0, 0, "5506 La Branch St.", "Houston", "TX", "77004");

            wayPoint1.Description = "CM";
            var wayPoint2 = new AllMedStop(0, 0, "8203 Town Creek Dr.", "Houston", "TX", "77095");

            wayPoint2.Description = "Parents";

            _stops.Clear();
            _stops.Add(origin);
            _stops.Add(wayPoint1);
            _stops.Add(wayPoint2);
        }
Esempio n. 6
0
        private void setMockDataWithGeocodes()
        {
            var origin = new AllMedStop(29.735190, -95.402986, "1722 Colquitt St.", "Houston", "TX", "77098");

            origin.Description = "House";
            var wayPoint1 = new AllMedStop(29.723229, -95.385316, "5506 La Branch St.", "Houston", "TX", "77004");

            wayPoint1.Description = "CM";
            var wayPoint2 = new AllMedStop(29.898562, -95.641385, "8203 Town Creek Dr.", "Houston", "TX", "77095");

            wayPoint2.Description = "Parents";

            _stops.Clear();
            _stops.Add(origin);
            _stops.Add(wayPoint1);
            _stops.Add(wayPoint2);
        }
Esempio n. 7
0
        public void ReorderCurrentStops()
        {
            int subtract = (!this.CurrentlySelectedRouter.IsRoundTrip ? 1 : 0) + 1;

            AllMedStop[] wayPointsArray = new AllMedStop[this.CurrentlySelectedStops.Count - subtract];
            this.CurrentlySelectedStops.CopyTo(1, wayPointsArray, 0, this.CurrentlySelectedStops.Count - subtract);

            List <AllMedStop> tempList = new List <AllMedStop>(wayPointsArray);

            for (int i = 0; i < this.CurrentlySelectedRouter.Legs.Count - 1; i++)
            {
                tempList[this.CurrentlySelectedRouter.Legs[i].DestinationIndex].Index = i;
            }
            tempList.Sort((t1, t2) => (t1.Index.CompareTo(t2.Index)));

            tempList.Insert(0, this.CurrentlySelectedRouter.Stops[0]);
            if (!this.CurrentlySelectedRouter.IsRoundTrip)
            {
                tempList.Add(this.CurrentlySelectedStops[this.CurrentlySelectedStops.Count - 1]);
            }
            this.CurrentlySelectedStops = tempList;
        }