void getDeviceIMSI() { string mImsi = GetImis(); if (string.IsNullOrEmpty(mImsi)) { imType = IMSI.NONE; } else if (mImsi.StartsWith("46000") || mImsi.StartsWith("46002") || mImsi.StartsWith("46007")) { // IMSI号前面3位460是国家,紧接着后面2位00 02 07是中国移动,01 06是中国联通,03 05是中国电信。 // netOperatorid = "cm"; imType = IMSI.CM; } else if (mImsi.StartsWith("46001") || mImsi.StartsWith("46006")) { imType = IMSI.UNI; // netOperatorid = "uni"; } else if (mImsi.StartsWith("46003") || mImsi.StartsWith("46005")) { imType = IMSI.CT; } else { imType = IMSI.NONE; } }
static public bool add(string imsi) { if (isExist(imsi)) { return(true); } lock (locker1) { IMSI x = new IMSI(imsi, DateTime.Now); return(dic.Add(x)); } }
/// <summary> /// Return the HashCode of this object. /// </summary> /// <returns>The HashCode of this object.</returns> public override Int32 GetHashCode() { unchecked { return(ChargePointVendor.GetHashCode() * 31 ^ ChargePointModel.GetHashCode() * 29 ^ ChargePointSerialNumber.GetHashCode() * 23 ^ FirmwareVersion.GetHashCode() * 17 ^ Iccid.GetHashCode() * 11 ^ IMSI.GetHashCode() * 7 ^ MeterType.GetHashCode() * 5 ^ MeterSerialNumber.GetHashCode()); } }
/// <summary> /// Compares two boot notification requests for equality. /// </summary> /// <param name="BootNotificationRequest">A boot notification request to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public override Boolean Equals(BootNotificationRequest BootNotificationRequest) { if ((Object)BootNotificationRequest == null) { return(false); } return(ChargePointVendor.Equals(BootNotificationRequest.ChargePointVendor) && ChargePointModel.Equals(BootNotificationRequest.ChargePointModel) && ChargePointSerialNumber.Equals(BootNotificationRequest.ChargePointSerialNumber) && FirmwareVersion.Equals(BootNotificationRequest.FirmwareVersion) && Iccid.Equals(BootNotificationRequest.Iccid) && IMSI.Equals(BootNotificationRequest.IMSI) && MeterType.Equals(BootNotificationRequest.MeterType) && MeterSerialNumber.Equals(BootNotificationRequest.MeterSerialNumber)); }
/// <summary> /// Return a JSON representation of this object. /// </summary> /// <param name="CustomBootNotificationRequestSerializer">A delegate to serialize custom boot notification requests.</param> public JObject ToJSON(CustomJObjectSerializerDelegate <BootNotificationRequest> CustomBootNotificationRequestSerializer = null) { var JSON = JSONObject.Create( new JProperty("chargePointVendor", ChargePointVendor), new JProperty("chargePointModel", ChargePointModel), ChargePointSerialNumber.IsNotNullOrEmpty() ? new JProperty("chargePointSerialNumber", ChargePointSerialNumber) : null, ChargeBoxSerialNumber.IsNotNullOrEmpty() ? new JProperty("chargeBoxSerialNumber", ChargeBoxSerialNumber) : null, FirmwareVersion.IsNotNullOrEmpty() ? new JProperty("firmwareVersion", FirmwareVersion) : null, Iccid.IsNotNullOrEmpty() ? new JProperty("iccid", Iccid) : null, IMSI.IsNotNullOrEmpty() ? new JProperty("imsi", IMSI) : null, MeterType.IsNotNullOrEmpty() ? new JProperty("meterType", MeterType) : null, MeterSerialNumber.IsNotNullOrEmpty() ? new JProperty("meterSerialNumber", MeterSerialNumber) : null ); return(CustomBootNotificationRequestSerializer != null ? CustomBootNotificationRequestSerializer(this, JSON) : JSON); }
/// <summary> /// Return the HashCode of this object. /// </summary> /// <returns>The HashCode of this object.</returns> public override Int32 GetHashCode() { unchecked { return(ChargePointVendor.GetHashCode() * 31 ^ ChargePointModel.GetHashCode() * 29 ^ (ChargePointSerialNumber != null ? ChargePointSerialNumber.GetHashCode() * 21 : 0) ^ (ChargeBoxSerialNumber != null ? ChargeBoxSerialNumber.GetHashCode() * 17 : 0) ^ (FirmwareVersion != null ? FirmwareVersion.GetHashCode() * 13 : 0) ^ (Iccid != null ? Iccid.GetHashCode() * 11 : 0) ^ (IMSI != null ? IMSI.GetHashCode() * 7 : 0) ^ (MeterType != null ? MeterType.GetHashCode() * 5 : 0) ^ (MeterSerialNumber != null ? MeterSerialNumber.GetHashCode() * 3 : 0)); } }