Example #1
0
        /// <summary>
        /// The remote stop was successful.
        /// </summary>
        /// <param name="ChargeDetailRecord">The charge detail record for a successfully stopped charging process.</param>
        /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param>
        /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param>
        public static RemoteStopResult Success(ChargeDetailRecord ChargeDetailRecord,
                                               ChargingReservation_Id?ReservationId    = null,
                                               ReservationHandling?ReservationHandling = null)

        => new RemoteStopResult(ChargeDetailRecord,
                                RemoteStopResultType.Success,
                                ReservationId,
                                ReservationHandling);
Example #2
0
 /// <summary>
 /// The remote stop was successful.
 /// </summary>
 /// <param name="ChargeDetailRecord">The charge detail record for a successfully stopped charging process.</param>
 /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param>
 /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param>
 public static RemoteStopEVSEResult Success(ChargeDetailRecord ChargeDetailRecord,
                                            ChargingReservation_Id ReservationId    = null,
                                            ReservationHandling ReservationHandling = null)
 {
     return(new RemoteStopEVSEResult(ChargeDetailRecord,
                                     RemoteStopEVSEResultType.Success,
                                     ReservationId,
                                     ReservationHandling));
 }
Example #3
0
        public void New(ChargeDetailRecord NewChargeDetailRecord)
        {
            lock (InternalData)
            {
                InternalData.Add(NewChargeDetailRecord.SessionId, new ChargeDetailRecordCollection(NewChargeDetailRecord));

                LogIt("new",
                      NewChargeDetailRecord.SessionId,
                      "chargeDetailRecords",
                      new JArray(NewChargeDetailRecord.ToJSON()));
            }
        }
Example #4
0
 public SendCDRResult(ChargeDetailRecord ChargeDetailRecord,
                      SendCDRResultTypes Result,
                      IEnumerable <String> Warnings = null)
 {
     this.ChargeDetailRecord = ChargeDetailRecord;
     this.Result             = Result;
     this.Warnings           = Warnings != null
                                    ? Warnings.Where(warning => warning != null).
                               SafeSelect(warning => warning.Trim()).
                               Where(warning => warning.IsNotNullOrEmpty())
                                    : new String[0];
 }
Example #5
0
        public SendCDRResult(ChargeDetailRecord ChargeDetailRecord,
                             SendCDRResultTypes Result,
                             String Warning)

            : this(ChargeDetailRecord,
                   Result,
                   Warning.IsNeitherNullNorEmpty()
                       ? new String[] { Warning }
                       : null)

        {
        }
Example #6
0
        /// <summary>
        /// Create a new remote stop result.
        /// </summary>
        /// <param name="ChargeDetailRecord">The charge detail record for a successfully stopped charging process.</param>
        /// <param name="Result">The result of the remote stop request.</param>
        /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param>
        /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param>
        private RemoteStopEVSEResult(ChargeDetailRecord ChargeDetailRecord,
                                     RemoteStopEVSEResultType Result,
                                     ChargingReservation_Id ReservationId,
                                     ReservationHandling ReservationHandling)
        {
            #region Initial checks

            if (ChargeDetailRecord == null)
            {
                throw new ArgumentNullException(nameof(ChargeDetailRecord), "The given charge detail record must not be null!");
            }

            #endregion

            this._ChargeDetailRecord  = ChargeDetailRecord;
            this._SessionId           = ChargeDetailRecord.SessionId;
            this._Result              = Result;
            this._ReservationId       = ReservationId;
            this._ReservationHandling = ReservationHandling != null ? ReservationHandling : ReservationHandling.Close;
        }