Пример #1
0
        public static Orchestrator.WebUI.Services.PointGeofence LoadPoint(int pointID)
        {
            if (pointID < 0)
            {
                return(null);
            }

            Services.GeoManagement geomanagement            = new Services.GeoManagement();
            Orchestrator.WebUI.Services.PointGeofence point = geomanagement.GetPointGeofence(pointID);

            Orchestrator.WebUI.Services.PointGeofence retVal = null;
            if (point != null)
            {
                retVal = point;
            }

            return(retVal);
        }
Пример #2
0
        void btnVehicleSave_Click(object sender, EventArgs e)
        {
            if (lbVehiclesInView.Items.Count > 0)
            {
                // only save/create if there are any vehicles in the view
                Services.GeoManagement geomanagement = new Services.GeoManagement();

                List <FleetViewTreeViewNode> selectedVehicles = new List <FleetViewTreeViewNode>();
                foreach (RadListBoxItem item in lbVehiclesInView.Items)
                {
                    selectedVehicles.Add(new FleetViewTreeViewNode()
                    {
                        Id = int.Parse(item.Value), GpsUnitId = item.Attributes["GPSUnitID"]
                    });
                }

                geomanagement.UpdatePointGeofenceVehicles(this.PointID, selectedVehicles);
            }
        }
Пример #3
0
        public static bool UpdatePoint(Orchestrator.WebUI.Services.PointGeofence point)
        {
            bool retval = true;

            try
            {
                Services.GeoManagement geomanagement = new Services.GeoManagement();

                var p   = geomanagement.UpdatePointGeofence(point, System.Threading.Thread.CurrentPrincipal.Identity.Name);
                var pin = geomanagement.GetPoint(point.PointID);

                // Make sure we update the points central location
                pin.Latitide  = point.Latitude;
                pin.Longitude = point.Longitude;
                geomanagement.UpdatePoint(pin, System.Threading.Thread.CurrentPrincipal.Identity.Name);
            }
            catch
            {
                retval = false;
            }
            return(retval);
        }
Пример #4
0
        protected void LoadVehicleScreen(int Id, bool initialLoad)
        {
            this.lblScreen.Text      = "Vehicles";
            this.pvVehicles.Selected = true;
            this.lbVehicles.Items.Clear();
            this.rtvGrouping.Nodes.Clear();
            Services.GeoManagement geomanagement = new Services.GeoManagement();
            var vehiclesInView = geomanagement.GetVehiclesForPointGeofence(this.PointID);
            var groups         = geomanagement.GetResourceViewsForVehicle();

            groups.ForEach(n => AddChildren(n, null));

            if (initialLoad)
            {
                foreach (var v in vehiclesInView.Where(a => !string.IsNullOrEmpty(a.GpsUnitId)).ToList().OrderBy(g => g.Description))
                {
                    if (!this.lbVehiclesInView.Items.Any(item => item.Value == v.Id.ToString()))
                    {
                        var item = new RadListBoxItem(v.Description, v.Id.ToString());
                        item.Attributes.Add("GPSUnitID", v.GpsUnitId);
                        item.Attributes.Add("ParentId", v.ParentId.ToString());
                        lbVehiclesInView.Items.Add(item);
                    }
                }
            }

            foreach (var v in allVehicles.Where(a => !string.IsNullOrEmpty(a.GpsUnitId) && a.ParentId == Id).ToList().OrderBy(g => g.Description))
            {
                if (!this.lbVehiclesInView.Items.Any(item => item.Value == v.Id.ToString()))
                {
                    var item = new RadListBoxItem(v.Description, v.Id.ToString());
                    item.Attributes.Add("GPSUnitID", v.GpsUnitId);
                    item.Attributes.Add("ParentId", v.ParentId.ToString());
                    lbVehicles.Items.Add(item);
                }
            }
        }