/// <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));
            }
        }
示例#2
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomGetServiceAuthorisationRequestSerializer">A delegate to serialize custom set EVSE busy status request XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <GetServiceAuthorisationRequest> CustomGetServiceAuthorisationRequestSerializer = null)
        {
            var XML = new XElement(eMIPNS.Authorisation + "eMIP_ToIOP_GetServiceAuthorisationRequest",

                                   TransactionId.HasValue
                              ? new XElement("transactionId", TransactionId.ToString())
                              : null,

                                   new XElement("partnerIdType", PartnerId.Format.AsText()),
                                   new XElement("partnerId", PartnerId.ToString()),

                                   new XElement("operatorIdType", OperatorId.Format.AsText()),
                                   new XElement("operatorId", OperatorId.ToString()),

                                   new XElement("EVSEIdType", EVSEId.Format.AsText()),
                                   new XElement("EVSEId", EVSEId.ToString()),

                                   new XElement("userIdType", UserId.Format.AsText()),
                                   new XElement("userId", UserId.ToString()),

                                   new XElement("requestedServiceId", RequestedServiceId.ToString()),

                                   PartnerServiceSessionId.HasValue
                              ? new XElement("partnerServiceSessionId", PartnerServiceSessionId.Value.ToString())
                              : null

                                   );


            return(CustomGetServiceAuthorisationRequestSerializer != null
                       ? CustomGetServiceAuthorisationRequestSerializer(this, XML)
                       : XML);
        }
        /// <summary>
        /// Compares two charge detail recordes for equality.
        /// </summary>
        /// <param name="ChargeDetailRecord">An 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) &&
                   MeterReports.Equals(ChargeDetailRecord.MeterReports) &&

                   ((!ExecPartnerSessionId.HasValue && !ChargeDetailRecord.ExecPartnerSessionId.HasValue) ||
                    (ExecPartnerSessionId.HasValue && ChargeDetailRecord.ExecPartnerSessionId.HasValue && ExecPartnerSessionId.Value.Equals(ChargeDetailRecord.ExecPartnerSessionId.Value))) &&

                   ((!ExecPartnerOperatorId.HasValue && !ChargeDetailRecord.ExecPartnerOperatorId.HasValue) ||
                    (ExecPartnerOperatorId.HasValue && ChargeDetailRecord.ExecPartnerOperatorId.HasValue && ExecPartnerOperatorId.Value.Equals(ChargeDetailRecord.ExecPartnerOperatorId.Value))) &&

                   ((!SalesPartnerSessionId.HasValue && !ChargeDetailRecord.SalesPartnerSessionId.HasValue) ||
                    (SalesPartnerSessionId.HasValue && ChargeDetailRecord.SalesPartnerSessionId.HasValue && SalesPartnerSessionId.Value.Equals(ChargeDetailRecord.SalesPartnerSessionId.Value))) &&

                   ((!SalesPartnerOperatorId.HasValue && !ChargeDetailRecord.SalesPartnerOperatorId.HasValue) ||
                    (SalesPartnerOperatorId.HasValue && ChargeDetailRecord.SalesPartnerOperatorId.HasValue && SalesPartnerOperatorId.Value.Equals(ChargeDetailRecord.SalesPartnerOperatorId.Value))) &&

                   ((!PartnerProductId.HasValue && !ChargeDetailRecord.PartnerProductId.HasValue) ||
                    (PartnerProductId.HasValue && ChargeDetailRecord.PartnerProductId.HasValue && PartnerProductId.Value.Equals(ChargeDetailRecord.PartnerProductId.Value))));
        }
示例#4
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomSetServiceAuthorisationRequestSerializer">A delegate to serialize custom set EVSE busy status request XML elements.</param>
        /// <param name="CustomMeterReportSerializer">A delegate to serialize custom MeterReport XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <SetServiceAuthorisationRequest> CustomSetServiceAuthorisationRequestSerializer = null,
                              CustomXMLSerializerDelegate <MeterReport> CustomMeterReportSerializer = null)
        {
            var XML = new XElement(eMIPNS.Authorisation + "eMIP_ToIOP_SetServiceAuthorisationRequest",

                                   TransactionId.HasValue
                              ? new XElement("transactionId", TransactionId.ToString())
                              : null,

                                   new XElement("partnerIdType", PartnerId.Format.AsText()),
                                   new XElement("partnerId", PartnerId.ToString()),

                                   new XElement("operatorIdType", OperatorId.Format.AsText()),
                                   new XElement("operatorId", OperatorId.ToString()),

                                   new XElement("EVSEIdType", EVSEId.Format.AsText()),
                                   new XElement("EVSEId", EVSEId.ToString()),

                                   new XElement("userIdType", UserId.Format.AsText()),
                                   new XElement("userId", UserId.ToString()),

                                   new XElement("requestedServiceId", RequestedServiceId.ToString()),
                                   new XElement("authorisationValue", AuthorisationValue.ToString()),
                                   new XElement("intermediateCDRRequested", IntermediateCDRRequested ? "1" : "0"),

                                   PartnerServiceSessionId.HasValue
                              ? new XElement("serviceSessionId", PartnerServiceSessionId.ToString())
                              : null,

                                   UserContractIdAlias.HasValue
                              ? new XElement("userContractIdAlias", UserContractIdAlias.ToString())
                              : null,

                                   MeterLimits.SafeAny()
                              ? new XElement("meterLimitList", MeterLimits.Select(meterreport => meterreport.ToXML(CustomMeterReportSerializer: CustomMeterReportSerializer)))
                              : null,

                                   Parameter.IsNotNullOrEmpty()
                              ? new XElement("parameter", Parameter)
                              : null,

                                   BookingId.HasValue
                              ? new XElement("bookingId", BookingId.ToString())
                              : null,

                                   SalePartnerBookingId.HasValue
                              ? new XElement("salePartnerBookingId", SalePartnerBookingId.ToString())
                              : null

                                   );


            return(CustomSetServiceAuthorisationRequestSerializer != null
                       ? CustomSetServiceAuthorisationRequestSerializer(this, XML)
                       : XML);
        }
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="SetServiceAuthorisationRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetServiceAuthorisationRequest SetServiceAuthorisationRequest)
        {

            if ((Object) SetServiceAuthorisationRequest == null)
                return false;

            return ((!TransactionId.HasValue && !SetServiceAuthorisationRequest.TransactionId.HasValue) ||
                     (TransactionId.HasValue && SetServiceAuthorisationRequest.TransactionId.HasValue && TransactionId.Value.Equals(SetServiceAuthorisationRequest.TransactionId.Value))) &&

                   PartnerId.         Equals(SetServiceAuthorisationRequest.PartnerId)          &&
                   OperatorId.        Equals(SetServiceAuthorisationRequest.OperatorId)         &&
                   EVSEId.            Equals(SetServiceAuthorisationRequest.EVSEId)             &&
                   UserId.            Equals(SetServiceAuthorisationRequest.UserId)             &&
                   RequestedServiceId.Equals(SetServiceAuthorisationRequest.RequestedServiceId);

                   //((!PartnerServiceSessionId.HasValue && !SetServiceAuthorisationRequest.PartnerServiceSessionId.HasValue) ||
                   //  (PartnerServiceSessionId.HasValue &&  SetServiceAuthorisationRequest.PartnerServiceSessionId.HasValue && PartnerServiceSessionId.Value.Equals(SetServiceAuthorisationRequest.PartnerServiceSessionId.Value)));

        }
示例#6
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 19
                            : 0) ^

                       PartnerId.GetHashCode() * 17 ^
                       OperatorId.GetHashCode() * 13 ^
                       EVSEId.GetHashCode() * 11 ^
                       UserId.GetHashCode() * 7 ^
                       RequestedServiceId.GetHashCode() * 3);

                //(PartnerServiceSessionId.HasValue
                //     ? PartnerServiceSessionId.GetHashCode()
                //     : 0);
            }
        }
示例#7
0
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="GetServiceAuthorisationRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(GetServiceAuthorisationRequest GetServiceAuthorisationRequest)
        {
            if ((Object)GetServiceAuthorisationRequest == null)
            {
                return(false);
            }

            return(((!TransactionId.HasValue && !GetServiceAuthorisationRequest.TransactionId.HasValue) ||
                    (TransactionId.HasValue && GetServiceAuthorisationRequest.TransactionId.HasValue && TransactionId.Value.Equals(GetServiceAuthorisationRequest.TransactionId.Value))) &&

                   PartnerId.Equals(GetServiceAuthorisationRequest.PartnerId) &&
                   OperatorId.Equals(GetServiceAuthorisationRequest.OperatorId) &&
                   EVSEId.Equals(GetServiceAuthorisationRequest.EVSEId) &&
                   UserId.Equals(GetServiceAuthorisationRequest.UserId) &&
                   RequestedServiceId.Equals(GetServiceAuthorisationRequest.RequestedServiceId) &&

                   ((!PartnerServiceSessionId.HasValue && !GetServiceAuthorisationRequest.PartnerServiceSessionId.HasValue) ||
                    (PartnerServiceSessionId.HasValue && GetServiceAuthorisationRequest.PartnerServiceSessionId.HasValue && PartnerServiceSessionId.Value.Equals(GetServiceAuthorisationRequest.PartnerServiceSessionId.Value))));
        }
示例#8
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(TransactionId.GetHashCode() * 21 ^
                       PartnerId.GetHashCode() * 19 ^
                       OperatorId.GetHashCode() * 17 ^
                       TargetOperatorId.GetHashCode() * 13 ^
                       EVSEId.GetHashCode() * 11 ^
                       UserId.GetHashCode() * 7 ^
                       RequestedServiceId.GetHashCode() * 5 ^

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

                       (BookingId.HasValue
                            ? BookingId.GetHashCode()
                            : 0));
            }
        }
示例#9
0
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="GetServiceAuthorisationRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(GetServiceAuthorisationRequest GetServiceAuthorisationRequest)
        {
            if (GetServiceAuthorisationRequest is null)
            {
                return(false);
            }

            return(TransactionId.Equals(GetServiceAuthorisationRequest.TransactionId) &&
                   PartnerId.Equals(GetServiceAuthorisationRequest.PartnerId) &&
                   OperatorId.Equals(GetServiceAuthorisationRequest.OperatorId) &&
                   TargetOperatorId.Equals(GetServiceAuthorisationRequest.TargetOperatorId) &&
                   EVSEId.Equals(GetServiceAuthorisationRequest.EVSEId) &&
                   UserId.Equals(GetServiceAuthorisationRequest.UserId) &&
                   RequestedServiceId.Equals(GetServiceAuthorisationRequest.RequestedServiceId) &&

                   ((!ServiceSessionId.HasValue && !GetServiceAuthorisationRequest.ServiceSessionId.HasValue) ||
                    (ServiceSessionId.HasValue && GetServiceAuthorisationRequest.ServiceSessionId.HasValue && ServiceSessionId.Value.Equals(GetServiceAuthorisationRequest.ServiceSessionId.Value))) &&

                   ((!BookingId.HasValue && !GetServiceAuthorisationRequest.BookingId.HasValue) ||
                    (BookingId.HasValue && GetServiceAuthorisationRequest.BookingId.HasValue && BookingId.Value.Equals(GetServiceAuthorisationRequest.BookingId.Value))));
        }
            /// <summary>
            /// Compares two charge detail record builder for equality.
            /// </summary>
            /// <param name="ChargeDetailRecordBuilder">A charge detail record builder to compare with.</param>
            /// <returns>True if both match; False otherwise.</returns>
            public Boolean Equals(Builder ChargeDetailRecordBuilder)
            {
                if (ChargeDetailRecordBuilder == null)
                {
                    return(false);
                }

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

                       ExecPartnerSessionId.Equals(ChargeDetailRecordBuilder.ExecPartnerSessionId) &&
                       ExecPartnerOperatorId.Equals(ChargeDetailRecordBuilder.ExecPartnerOperatorId) &&
                       SalesPartnerSessionId.Equals(ChargeDetailRecordBuilder.SalesPartnerSessionId) &&
                       SalesPartnerOperatorId.Equals(ChargeDetailRecordBuilder.SalesPartnerOperatorId) &&
                       PartnerProductId.Equals(ChargeDetailRecordBuilder.PartnerProductId) &&
                       MeterReports.Equals(ChargeDetailRecordBuilder.MeterReports));
            }
        /// <summary>
        /// Return a XML representation of this EVSE data record.
        /// </summary>
        /// <param name="XName">The XML name to use.</param>
        /// <param name="CustomChargeDetailRecordSerializer">A delegate to serialize custom ChargeDetailRecord XML elements.</param>
        /// <param name="CustomMeterReportSerializer">A delegate to serialize custom MeterReport XML elements.</param>
        public XElement ToXML(XName XName = null,
                              CustomXMLSerializerDelegate <ChargeDetailRecord> CustomChargeDetailRecordSerializer = null,
                              CustomXMLSerializerDelegate <MeterReport> CustomMeterReportSerializer = null)
        {
            var XML = new XElement(XName ?? "chargeDetailRecord",

                                   new XElement("CDRNature", CDRNature.AsText()),
                                   new XElement("serviceSessionId", ServiceSessionId.ToString()),

                                   ExecPartnerSessionId.HasValue
                              ? new XElement("execPartnerSessionId", ExecPartnerSessionId.Value.ToString())
                              : null,

                                   ExecPartnerOperatorId.HasValue
                              ? new XElement("execPartnerOperatorIdType", ExecPartnerOperatorId.Value.Format.AsText())
                              : null,

                                   ExecPartnerOperatorId.HasValue
                              ? new XElement("execPartnerOperatorId", ExecPartnerOperatorId.Value.ToString())
                              : null,


                                   SalesPartnerSessionId.HasValue
                              ? new XElement("execPartnerSessionId", ExecPartnerSessionId.Value.ToString())
                              : null,

                                   SalesPartnerOperatorId.HasValue
                              ? new XElement("execPartnerOperatorIdType", ExecPartnerOperatorId.Value.Format.AsText())
                              : null,

                                   SalesPartnerOperatorId.HasValue
                              ? new XElement("execPartnerOperatorId", ExecPartnerOperatorId.Value.ToString())
                              : null,


                                   new XElement("requestedServiceId", RequestedServiceId.ToString()),

                                   new XElement("EVSEIdType", EVSEId.Format.AsText()),
                                   new XElement("EVSEId", EVSEId.ToString()),

                                   new XElement("userContractIdAlias", UserContractIdAlias.ToString()),

                                   new XElement("userIdType", UserId.Format.AsText()),
                                   new XElement("userId", UserId.ToString()),

                                   PartnerProductId.HasValue
                              ? new XElement("partnerProductId", PartnerProductId.Value.ToString())
                              : null,

                                   new XElement("startTime", StartTime.ToIso8601(false)),
                                   new XElement("endTime", EndTime.ToIso8601(false)),

                                   new XElement("meterReportList",
                                                MeterReports.Any()
                                  ? MeterReports.Select(meterreport => meterreport.ToXML(CustomMeterReportSerializer: CustomMeterReportSerializer))
                                  : null
                                                )

                                   );

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