public static void InitTruckPositions()
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Utils", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "InitTruckPositions")) {
         try {
             DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent southGrRa = new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().GetAsQueryable <DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent>((ra) => ra.AgencyCode == "AG.265")?.FirstOrDefault();
             System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck> trucks = southGrRa?.Trucks;
             DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates creteGeo = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates();
             creteGeo.Latitude = float.Parse("35.317223", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); creteGeo.Longitude = float.Parse("25.099130", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); if (((trucks?.Count() ?? 0) > 0))
             {
                 zAppDev.DotNet.Framework.Utilities.Common.GetItemFromList(trucks, 0).CurrentLocation = creteGeo;
             }
             DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates athensGeo = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates();
             athensGeo.Latitude = float.Parse("37.923545", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); athensGeo.Longitude = float.Parse("23.889674", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); if (((trucks?.Count() ?? 0) > 1))
             {
                 zAppDev.DotNet.Framework.Utilities.Common.GetItemFromList(trucks, 1).CurrentLocation = athensGeo;
             }
             DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates athGeo = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates();
             athGeo.Latitude = float.Parse("38.008472", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); athGeo.Longitude = float.Parse("23.715051", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); if (((trucks?.Count() ?? 0) > 2))
             {
                 zAppDev.DotNet.Framework.Utilities.Common.GetItemFromList(trucks, 2).CurrentLocation = athGeo;
             }
             new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Save <DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent>(southGrRa);
             DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent northRa = new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().GetAsQueryable <DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent>((rag) => rag.AgencyCode == "A.G.709")?.FirstOrDefault();
             System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck> northtrucks = northRa?.Trucks;
             DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates lamiaGeo = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates();
             lamiaGeo.Latitude = float.Parse("38.903778", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); lamiaGeo.Longitude = float.Parse("22.541465", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); if (((northtrucks?.Count() ?? 0) > 0))
             {
                 zAppDev.DotNet.Framework.Utilities.Common.GetItemFromList(northtrucks, 0).CurrentLocation = lamiaGeo;
             }
             DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates IoanninaGeo = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates();
             IoanninaGeo.Latitude = float.Parse("39.655994", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); IoanninaGeo.Longitude = float.Parse("20.826959", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); if (((northtrucks?.Count() ?? 0) > 1))
             {
                 zAppDev.DotNet.Framework.Utilities.Common.GetItemFromList(northtrucks, 1).CurrentLocation = IoanninaGeo;
             }
             DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates LarissaGeo = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GeoCoordinates();
             LarissaGeo.Latitude = float.Parse("39.590443", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); LarissaGeo.Longitude = float.Parse("22.488873", System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture); if (((northtrucks?.Count() ?? 0) > 2))
             {
                 zAppDev.DotNet.Framework.Utilities.Common.GetItemFromList(northtrucks, 2).CurrentLocation = LarissaGeo;
             }
             new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Save <DSS3_LogisticsPoolingForUrbanDistribution.BO.RegionalAgent>(northRa);
             foreach (var truck in trucks ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck>())
             {
                 DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation gpsloc = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation();
                 gpsloc.truck_license_plate = (truck?.PlateNumber ?? ""); gpsloc.latitude = (truck?.CurrentLocation?.Latitude ?? 0); gpsloc.longitude = (truck?.CurrentLocation?.Longitude ?? 0); gpsloc.timestamp = DSS3_LogisticsPoolingForUrbanDistribution.BO.UtilsExtensions.ConvertToTimestampFormat(DateTime.UtcNow); gpsloc?.Publish();
             }
             foreach (var truck in northtrucks ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.Truck>())
             {
                 DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation gpsloc = new DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation();
                 gpsloc.truck_license_plate = (truck?.PlateNumber ?? ""); gpsloc.latitude = (truck?.CurrentLocation?.Latitude ?? 0); gpsloc.longitude = (truck?.CurrentLocation?.Longitude ?? 0); gpsloc.timestamp = DSS3_LogisticsPoolingForUrbanDistribution.BO.UtilsExtensions.ConvertToTimestampFormat(DateTime.UtcNow); gpsloc?.Publish();
             }
         }
         catch (System.Exception x) {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Error, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "init truck positions");
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Error, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, x);
         }
     }
 }
 public static void DeserializeMessage(string json)
 {
     using (new zAppDev.DotNet.Framework.Profiling.Profiler("Utils", zAppDev.DotNet.Framework.Profiling.AppDevSymbolType.ClassOperation, "DeserializeMessage")) {
         try {
             zAppDev.DotNet.Framework.Utilities.Serializer <System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage> > ser = new zAppDev.DotNet.Framework.Utilities.Serializer <System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage> >();
             zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderDTO> ord     = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderDTO>();
             System.Collections.Generic.List <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage>             kvpairs = ser.FromJson(json);
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Starting message parsing... JSON contains " + (kvpairs?.Count() ?? 0) + " objects");
             foreach (var mes in kvpairs ?? Enumerable.Empty <DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage>())
             {
                 if ((mes?.key == "sarmed_order" && int.Parse((mes?.val ?? "")) > 0))
                 {
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Order received!");
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage payload = kvpairs?.FirstOrDefault((x) => x.key == "payload");
                     string orderjson = zAppDev.DotNet.Framework.Utilities.Common.Base64Decode((payload?.val ?? ""));
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderDTO tempDTO = ord.FromJson(orderjson);
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS temp = (new DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderTransformationDataTransformation.Transformer()).OrderWMS_To_OrderDTOReversed(tempDTO);
                     var _var0 = temp?.OrdID; DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS tempord = new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().GetAsQueryable <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>((x) => x.OrdID == _var0)?.FirstOrDefault();
                     if ((tempord != null))
                     {
                         zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Order found in database. Updating...");
                         tempord?.CopyFields(temp);
                         if ((tempord?.OrdRoutingStatus == 30))
                         {
                             tempord.ATA = DateTime.UtcNow; System.Collections.Generic.List <string> roles = new System.Collections.Generic.List <string>();
                             foreach (var role in zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.Roles ?? Enumerable.Empty <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>())
                             {
                                 roles.Add((role?.Name ?? ""));
                             }
                             tempord.OrdStatus = 30; new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Update <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>(tempord);
                             DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseSaveOrder((tempord?.OrdID ?? 0), roles.ToArray());
                         }
                         else
                         {
                             new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Save <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>(tempord);
                             System.Collections.Generic.List <string> roles = new System.Collections.Generic.List <string>();
                             foreach (var role in zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.Roles ?? Enumerable.Empty <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>())
                             {
                                 roles.Add((role?.Name ?? ""));
                             }
                             DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseUpdateDatasets((tempord?.Id ?? 0), roles.ToArray());
                         }
                     }
                     else
                     {
                         zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "New order received!");
                         if ((temp?.OrdRoutingStatus == 30))
                         {
                             temp.ATA = DateTime.UtcNow;
                         }
                         new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Save <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>(temp);
                     }
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Order saved successfully.");
                     zAppDev.DotNet.Framework.Data.MiniSessionManager.Instance.Session.Flush();
                     if ((temp?.OrdRoutingStatus == 20))
                     {
                         DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseOrderStarted((temp?.OrdID ?? 0), (temp?.OrdVchPlateNr ?? ""));
                     }
                     else if ((temp?.OrdRoutingStatus == 30))
                     {
                         DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseOrderFinished((temp?.OrdID ?? 0));
                     }
                     else
                     {
                         System.Collections.Generic.List <string> roles = new System.Collections.Generic.List <string>();
                         foreach (var role in zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.Roles ?? Enumerable.Empty <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>())
                         {
                             roles.Add((role?.Name ?? ""));
                         }
                         DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseOnOrderReceive((temp?.OrdID ?? 0), (temp?.Warehouse ?? ""), (temp?.OrdDlsCity ?? ""), (temp?.OrdAgencyDescr ?? ""), roles.ToArray());
                     }
                 }
                 else if ((mes?.key == "truck_location"))
                 {
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Truck location received!");
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage payload = kvpairs?.FirstOrDefault((x) => x.key == "payload");
                     string gpsjson = zAppDev.DotNet.Framework.Utilities.Common.Base64Decode((payload?.val ?? ""));
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "gps data " + gpsjson);
                     zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation> gps = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation>();
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.GPSLocation temp = gps.FromJson(gpsjson);
                     DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseOnGPSReceive((temp?.truck_license_plate ?? ""), (temp?.latitude?.ToString() ?? ""), (temp?.longitude?.ToString() ?? ""));
                 }
                 else if ((mes?.key == "sarmed_truck_recommendation" && int.Parse((mes?.val ?? "")) > 0))
                 {
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage payload = kvpairs?.FirstOrDefault((x) => x.key == "payload");
                     string truckRec = zAppDev.DotNet.Framework.Utilities.Common.Base64Decode((payload?.val ?? ""));
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "TruckRec " + truckRec);
                     zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.DisruptionAPI.TrucksRecommended> truckSer = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.DisruptionAPI.TrucksRecommended>();
                     DSS3_LogisticsPoolingForUrbanDistribution.ExternalStructs.DisruptionAPI.TrucksRecommended truck = truckSer.FromJson(truckRec);
                     System.Collections.Generic.List <string> roles = new System.Collections.Generic.List <string>();
                     foreach (var role in zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.Roles ?? Enumerable.Empty <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>())
                     {
                         roles.Add((role?.Name ?? ""));
                     }
                     DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseOnNTUARecommendationReceive(truck.order_id, zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(truck.trucks_recommended, 0), roles.ToArray());
                 }
                 else if ((mes?.key == "sarmed_truck_eta"))
                 {
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage payload = kvpairs?.FirstOrDefault((x) => x.key == "payload");
                     string trucketa = zAppDev.DotNet.Framework.Utilities.Common.Base64Decode((payload?.val ?? ""));
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "Truck eta mess " + trucketa);
                     zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.truck_eta> truckSer = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.truck_eta>();
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.truck_eta truck = truckSer.FromJson(trucketa);
                     var _var1 = truck?.order_id; DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS orderETA = new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().GetAsQueryable <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>((ordETA) => ordETA.OrdID == _var1)?.FirstOrDefault();
                     DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseOnETAReceived((truck?.truck_license_plate ?? ""), (truck?.eta ?? System.Data.SqlTypes.SqlDateTime.MinValue.Value), (truck?.order_id ?? 0));
                 }
                 else if ((mes?.key == "sarmed_truck_emissions"))
                 {
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage payload = kvpairs?.FirstOrDefault((x) => x.key == "payload");
                     string truckemiss = zAppDev.DotNet.Framework.Utilities.Common.Base64Decode((payload?.val ?? ""));
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "co2 " + truckemiss);
                     zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.truck_emission> truckSer = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.truck_emission>();
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.truck_emission truck = truckSer.FromJson(truckemiss);
                     var   _var2 = truck?.truck_license_plate; DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS orderCOE = new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().GetAsQueryable <DSS3_LogisticsPoolingForUrbanDistribution.BO.OrderWMS>((ordco) => ordco.OrdVchPlateNr == _var2 && ordco.OrdRoutingStatus == 20)?.FirstOrDefault();
                     float?co2em = float.Parse((truck?.co2_emission ?? ""), System.Globalization.NumberStyles.Number | System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture);
                     co2em = co2em.GetValueOrDefault(0) / 1000; truck.co2_emission = (co2em?.ToString() ?? ""); DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseOnCO2Received((truck?.truck_license_plate ?? ""), (truck?.co2_emission ?? ""));
                 }
                 else if ((mes?.key == "sarmed_truck_delivery_time"))
                 {
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.PubMessage payload = kvpairs?.FirstOrDefault((x) => x.key == "payload");
                     string truckAVGtime = zAppDev.DotNet.Framework.Utilities.Common.Base64Decode((payload?.val ?? ""));
                     zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, "avg time " + truckAVGtime);
                     zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.AVGTime> avgSer = new zAppDev.DotNet.Framework.Utilities.Serializer <DSS3_LogisticsPoolingForUrbanDistribution.BO.AVGTime>();
                     DSS3_LogisticsPoolingForUrbanDistribution.BO.AVGTime avg = avgSer.FromJson(truckAVGtime);
                     new DSS3_LogisticsPoolingForUrbanDistribution.DAL.Repository().Save <DSS3_LogisticsPoolingForUrbanDistribution.BO.AVGTime>(avg);
                 }
             }
         }
         catch (System.Exception x) {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Error, "Utils", DSS3_LogisticsPoolingForUrbanDistribution.Hubs.EventsHub.RaiseDebugMessage, x);
         }
     }
 }