/// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(ProviderId.GetHashCode() * 17 ^
                       EVSEId.GetHashCode() * 13 ^
                       Identification.GetHashCode() * 11 ^

                       (SessionId.HasValue
                            ? SessionId.GetHashCode() * 9
                            : 0) ^

                       (CPOPartnerSessionId.HasValue
                            ? CPOPartnerSessionId.GetHashCode() * 7
                            : 0) ^

                       (EMPPartnerSessionId.HasValue
                            ? EMPPartnerSessionId.GetHashCode() * 5
                            : 0) ^

                       (PartnerProductId.HasValue
                            ? PartnerProductId.GetHashCode() * 3
                            : 0) ^

                       (Duration.HasValue
                            ? Duration.GetHashCode()
                            : 0));
            }
        }
Пример #2
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(OperatorId.GetHashCode() * 13 ^
                       Identification.GetHashCode() * 11 ^

                       (EVSEId != null
                            ? EVSEId.GetHashCode() * 9
                            : 0) ^

                       (PartnerProductId != null
                            ? PartnerProductId.GetHashCode() * 7
                            : 0) ^

                       (SessionId != null
                            ? SessionId.GetHashCode() * 5
                            : 0) ^

                       (CPOPartnerSessionId != null
                            ? CPOPartnerSessionId.GetHashCode() * 3
                            : 0) ^

                       (EMPPartnerSessionId != null
                            ? EMPPartnerSessionId.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(CDRNature.GetHashCode() * 41 ^
                       ServiceSessionId.GetHashCode() * 37 ^
                       RequestedServiceId.GetHashCode() * 31 ^
                       EVSEId.GetHashCode() * 27 ^
                       UserContractIdAlias.GetHashCode() * 23 ^
                       UserId.GetHashCode() * 21 ^
                       StartTime.GetHashCode() * 19 ^
                       EndTime.GetHashCode() * 17 ^
                       MeterReports.GetHashCode() * 13 ^

                       (ExecPartnerSessionId.HasValue
                            ? ExecPartnerSessionId.GetHashCode() * 11
                            : 0) ^

                       (ExecPartnerOperatorId.HasValue
                            ? ExecPartnerOperatorId.GetHashCode() * 7
                            : 0) ^

                       (SalesPartnerSessionId.HasValue
                            ? SalesPartnerSessionId.GetHashCode() * 5
                            : 0) ^

                       (SalesPartnerOperatorId.HasValue
                            ? SalesPartnerOperatorId.GetHashCode() * 3
                            : 0) ^

                       (PartnerProductId.HasValue
                            ? PartnerProductId.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(OperatorId.GetHashCode() * 17 ^
                       Identification.GetHashCode() * 13 ^

                       (EVSEId?.GetHashCode() ?? 0) * 11 ^
                       (SessionId?.GetHashCode() ?? 0) * 7 ^
                       (CPOPartnerSessionId?.GetHashCode() ?? 0) * 5 ^
                       (EMPPartnerSessionId?.GetHashCode() ?? 0) * 3 ^
                       (PartnerProductId?.GetHashCode() ?? 0));
            }
        }
Пример #5
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(EVSEId.GetHashCode() * 7 ^
                       QRCodeIdentification.GetHashCode() * 5 ^

                       (PartnerProductId.HasValue
                            ? PartnerProductId.GetHashCode() * 3
                            : 0) ^

                       (!GetNewSession.HasValue
                            ? GetNewSession.GetHashCode()
                            : 0));
            }
        }
            /// <summary>
            /// Compares two charge detail records for equality.
            /// </summary>
            /// <param name="ChargeDetailRecord">A charge detail record to compare with.</param>
            /// <returns>True if both match; False otherwise.</returns>
            public Boolean Equals(ChargeDetailRecord ChargeDetailRecord)
            {
                if ((Object)ChargeDetailRecord == null)
                {
                    return(false);
                }

                return(CDRNature.Equals(ChargeDetailRecord.CDRNature) &&
                       ServiceSessionId.Equals(ChargeDetailRecord.ServiceSessionId) &&
                       RequestedServiceId.Equals(ChargeDetailRecord.RequestedServiceId) &&
                       EVSEId.Equals(ChargeDetailRecord.EVSEId) &&
                       UserContractIdAlias.Equals(ChargeDetailRecord.UserContractIdAlias) &&
                       UserId.Equals(ChargeDetailRecord.UserId) &&
                       StartTime.Equals(ChargeDetailRecord.StartTime) &&
                       EndTime.Equals(ChargeDetailRecord.EndTime) &&

                       ExecPartnerSessionId.Equals(ChargeDetailRecord.ExecPartnerSessionId) &&
                       ExecPartnerOperatorId.Equals(ChargeDetailRecord.ExecPartnerOperatorId) &&
                       SalesPartnerSessionId.Equals(ChargeDetailRecord.SalesPartnerSessionId) &&
                       SalesPartnerOperatorId.Equals(ChargeDetailRecord.SalesPartnerOperatorId) &&
                       PartnerProductId.Equals(ChargeDetailRecord.PartnerProductId) &&
                       MeterReports.Equals(ChargeDetailRecord.MeterReports));
            }
Пример #7
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomAuthorizeStartRequestSerializer">A delegate to customize the serialization of AuthorizeStart requests.</param>
        /// <param name="CustomIdentificationSerializer">A delegate to serialize custom Identification XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <AuthorizeStartRequest> CustomAuthorizeStartRequestSerializer = null,
                              CustomXMLSerializerDelegate <Identification> CustomIdentificationSerializer = null)
        {
            var XML = new XElement(OICPNS.Authorization + "eRoamingAuthorizeStart",

                                   SessionId.HasValue
                                           ? new XElement(OICPNS.Authorization + "SessionID", SessionId.ToString())
                                           : null,

                                   CPOPartnerSessionId.HasValue
                                           ? new XElement(OICPNS.Authorization + "CPOPartnerSessionID", CPOPartnerSessionId.ToString())
                                           : null,

                                   EMPPartnerSessionId.HasValue
                                           ? new XElement(OICPNS.Authorization + "EMPPartnerSessionID", EMPPartnerSessionId.ToString())
                                           : null,

                                   new XElement(OICPNS.Authorization + "OperatorID", OperatorId.ToString()),

                                   EVSEId.HasValue
                                           ? new XElement(OICPNS.Authorization + "EvseID", EVSEId.ToString())
                                           : null,

                                   Identification.ToXML(CustomIdentificationSerializer: CustomIdentificationSerializer),

                                   PartnerProductId.HasValue
                                           ? new XElement(OICPNS.Authorization + "PartnerProductID", PartnerProductId.ToString())
                                           : null

                                   );

            return(CustomAuthorizeStartRequestSerializer != null
                       ? CustomAuthorizeStartRequestSerializer(this, XML)
                       : XML);
        }
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomAuthorizeRemoteReservationStartRequestSerializer">A delegate to customize the serialization of AuthorizeRemoteReservationStart requests.</param>
        /// <param name="CustomIdentificationSerializer">A delegate to serialize custom Identification XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <AuthorizeRemoteReservationStartRequest> CustomAuthorizeRemoteReservationStartRequestSerializer = null,
                              CustomXMLSerializerDelegate <Identification> CustomIdentificationSerializer = null)

        {
            var XML = new XElement(OICPNS.Reservation + "eRoamingAuthorizeRemoteReservationStart",

                                   SessionId.HasValue
                                           ? new XElement(OICPNS.Reservation + "SessionID", SessionId.ToString())
                                           : null,

                                   CPOPartnerSessionId.HasValue
                                           ? new XElement(OICPNS.Reservation + "CPOPartnerSessionID", CPOPartnerSessionId.ToString())
                                           : null,

                                   EMPPartnerSessionId.HasValue
                                           ? new XElement(OICPNS.Reservation + "EMPPartnerSessionID", EMPPartnerSessionId.ToString())
                                           : null,

                                   new XElement(OICPNS.Reservation + "ProviderID", ProviderId.ToString()),
                                   new XElement(OICPNS.Reservation + "EVSEID", EVSEId.ToString()),

                                   Identification.ToXML(OICPNS.Reservation + "Identification",
                                                        CustomIdentificationSerializer),

                                   PartnerProductId.HasValue
                                           ? new XElement(OICPNS.Reservation + "PartnerProductID", PartnerProductId.ToString())
                                           : null,

                                   Duration.HasValue
                                           ? new XElement(OICPNS.Reservation + "Duration", Convert.ToInt32(Math.Round(Duration.Value.TotalMinutes, 0)))
                                           : null

                                   );

            return(CustomAuthorizeRemoteReservationStartRequestSerializer != null
                       ? CustomAuthorizeRemoteReservationStartRequestSerializer(this, XML)
                       : XML);
        }
Пример #9
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomMobileAuthorizeStartRequestSerializer">A delegate to serialize custom MobileAuthorizeStart XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <MobileAuthorizeStartRequest> CustomMobileAuthorizeStartRequestSerializer = null)
        {
            var XML = new XElement(OICPNS.MobileAuthorization + "eRoamingMobileAuthorizeStart",

                                   new XElement(OICPNS.MobileAuthorization + "EvseID", EVSEId.ToString()),

                                   QRCodeIdentification.ToXML(OICPNS.MobileAuthorization + "QRCodeIdentification"),

                                   PartnerProductId.HasValue
                                          ? new XElement(OICPNS.MobileAuthorization + "PartnerProductID", PartnerProductId.ToString())
                                          : null,

                                   (GetNewSession.HasValue)
                                          ? new XElement(OICPNS.MobileAuthorization + "GetNewSession", GetNewSession.Value ? "true" : "false")
                                          : null

                                   );

            return(CustomMobileAuthorizeStartRequestSerializer != null
                       ? CustomMobileAuthorizeStartRequestSerializer(this, XML)
                       : XML);
        }