當前位置: 首頁>>代碼示例>>C#>>正文


C# PartnerTrip.UpdateTripStatus方法代碼示例

本文整理匯總了C#中TripThruCore.PartnerTrip.UpdateTripStatus方法的典型用法代碼示例。如果您正苦於以下問題:C# PartnerTrip.UpdateTripStatus方法的具體用法?C# PartnerTrip.UpdateTripStatus怎麽用?C# PartnerTrip.UpdateTripStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TripThruCore.PartnerTrip的用法示例。


在下文中一共展示了PartnerTrip.UpdateTripStatus方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MakeTripPickedUp

 private void MakeTripPickedUp(PartnerTrip trip)
 {
     Logger.Log("Picking up: " + trip);
     Logger.Tab();
     DateTime eta = UpdateDriverRouteAndGetETA(trip.driver, trip.dropoffLocation);
     trip.UpdateTripStatus(notifyPartner: true, status: Status.PickedUp, driverLocation: trip.driver.location, eta: eta);
     Logger.Untab();
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:8,代碼來源:1396654558$PartnerGateway.cs

示例2: MakeTripComplete

 private void MakeTripComplete(PartnerTrip t)
 {
     Logger.Log("The destination has been reached for: " + t);
     Logger.Tab();
     t.dropoffTime = DateTime.UtcNow;
     CompleteTrip(t);
     t.UpdateTripStatus(notifyPartner: true, status: Status.Complete);
     Logger.Untab();
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:9,代碼來源:1396654558$PartnerGateway.cs

示例3: MakeTripEnroute

 private void MakeTripEnroute(PartnerTrip trip)
 {
     Logger.Log("Driver is now enroute: " + trip);
     Logger.Tab();
     DateTime eta = UpdateDriverRouteAndGetETA(trip.driver, trip.pickupLocation);
     trip.UpdateTripStatus(notifyPartner: true, status: Status.Enroute, driverLocation: trip.driver.location, eta: eta);
     Logger.Untab();
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:8,代碼來源:1396654558$PartnerGateway.cs

示例4: CancelTrip

 private static void CancelTrip(PartnerTrip t)
 {
     Logger.Log("Missed period reached: -- so cancel " + t);
     Logger.Tab();
     t.UpdateTripStatus(notifyPartner: true, status: Status.Cancelled);
     Logger.Untab();
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:7,代碼來源:1396654558$PartnerGateway.cs

示例5: TryDispatchTripLocally

 public bool TryDispatchTripLocally(PartnerTrip t)
 {
     Logger.Log("DispatchTripLocally");
     if (!FleetServesLocation(t.pickupLocation))
     {
         Logger.Log("Pickup location " + t.pickupLocation + " is outside of coverage area");
         return false;
     }
     if (t.status != Status.Queued)
         throw new Exception("Invalid 'Dispatch' status");
     if (ThereAreAvailableDrivers())
     {
         DispatchToFirstAvailableDriver(t);
         t.UpdateTripStatus(notifyPartner: true, status: Status.Dispatched, driverLocation: t.driver.location, eta: t.pickupTime);
         return true;
     }
     Logger.Log("No drivers are currently available");
     return false;
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:19,代碼來源:1396654558$PartnerGateway.cs

示例6: QueueTrip

 public bool QueueTrip(PartnerTrip t)
 {
     lock (locker)
     {
         if (availableDrivers.Count == 0 && t.origination == PartnerTrip.Origination.Foreign)
             return false; // don't except from parters if no available drivers
         Logger.Log("Queueing " + t);
         queue.AddLast(t);
         partner.tripsByID.Add(t.ID, t);
         partner.activeTrips.Add(t.ID, new Trip
         {
             FleetId = t.PartnerFleet != null ? t.PartnerFleet.ID : null,
             FleetName = t.PartnerFleet != null ? t.PartnerFleet.name : null,
             DriverId = t.driver != null ? t.driver.ID : null,
             DriverLocation = t.driver != null ? t.driver.location : null,
             DriverName = t.driver != null ? t.driver.name : null,
             DropoffLocation = t.dropoffLocation,
             DriverInitiaLocation = null,
             DropoffTime = t.dropoffTime,
             Id = t.ID,
             OriginatingPartnerId = this.ID,
             OriginatingPartnerName = this.name,
             PassengerName = t.passengerName,
             PickupLocation = t.pickupLocation,
             PickupTime = t.pickupTime,
             Price = t.price,
             Status = t.status,
             VehicleType = t.vehicleType,
         });
         t.UpdateTripStatus(notifyPartner: false, status: Status.Queued);
         return true;
     }
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:33,代碼來源:1396654558$PartnerGateway.cs

示例7: GetTripStatusFromForeignServiceProvider

 // speed is miles per hour
 public void GetTripStatusFromForeignServiceProvider(PartnerTrip trip, bool force = false)
 {
     if (force || DateTime.UtcNow > trip.lastUpdate + updateInterval && trip.status != Status.Complete)
     {
         Logger.Log("Getting (Foreign) status of " + trip);
         Logger.Tab();
         Gateway.GetTripStatusRequest request = new Gateway.GetTripStatusRequest(clientID: ID, tripID: trip.ID);
         Gateway.GetTripStatusResponse response = tripthru.GetTripStatus(request);
         if (response.status != null)
             trip.UpdateTripStatus(notifyPartner: false, status: (Status)response.status, driverLocation: response.driverLocation, eta: response.ETA); // todo: not good -- fix this.
         if (response.driverName != null)
             trip.driver = new Driver(name: response.driverName, location: response.driverLocation);
         if (response.dropoffTime != null)
             trip.dropoffTime = response.dropoffTime;
         if (response.vehicleType != null)
             trip.vehicleType = response.vehicleType;
         if (response.distance != null)
             trip.distance = response.distance;
         Logger.Untab();
         trip.lastUpdate = DateTime.UtcNow;
     }
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:23,代碼來源:1396654558$PartnerGateway.cs

示例8: QueueTrip

 public bool QueueTrip(PartnerTrip t)
 {
     lock (locker)
     {
         if (availableDrivers.Count == 0 && t.origination == PartnerTrip.Origination.Foreign)
             return false; // don't except from parters if no available drivers
         Logger.Log("Queueing " + t);
         queue.AddLast(t);
         if (partner.activeTrips.ContainsKey(t.ID))
             throw new Exception("Trip " + t + ": already exist in activeTrips dictionary -- Existing trip = " + partner.activeTrips[t.ID]);
         if (partner.tripsByID.ContainsKey(t.ID))
             throw new Exception("Trip " + t + ": already exist in tripsByID dictionary");
         partner.tripsByID.Add(t.ID, t);
         partner.activeTrips.Add(t.ID, new Trip
         {
             FleetId = t.PartnerFleet != null ? t.PartnerFleet.ID : null,
             FleetName = t.PartnerFleet != null ? t.PartnerFleet.name : null,
             DriverId = t.driver != null ? t.driver.ID : null,
             DriverLocation = t.driver != null ? t.driver.location : null,
             DriverName = t.driver != null ? t.driver.name : null,
             DropoffLocation = t.dropoffLocation,
             DriverInitiaLocation = t.driverInitiaLocation ?? null,
             DropoffTime = t.dropoffTime,
             Id = t.ID,
             OriginatingPartnerId = this.ID,
             OriginatingPartnerName = this.name,
             PassengerName = t.passengerName,
             PickupLocation = t.pickupLocation,
             PickupTime = t.pickupTime,
             Price = t.price,
             Status = t.status,
             VehicleType = t.vehicleType,
             SamplingPercentage = 1
         });
         t.UpdateTripStatus(notifyPartner: false, status: Status.Queued);
         return true;
     }
 }
開發者ID:TripThru,項目名稱:Gateway,代碼行數:38,代碼來源:PartnerGateway.cs


注:本文中的TripThruCore.PartnerTrip.UpdateTripStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。