예제 #1
0
 public SIMHardware(CLI CLI,
                    SIM_Id?SIMNumber,
                    String Description,
                    String InventoryRef,
                    SimCardStates State,
                    UInt64?Version,
                    Byte?ActorStatus,
                    String ForeignAttributes,
                    String Tariff,
                    String Bundle,
                    Operator_Id?Operator,
                    String Hints,
                    Byte?NetworkStatus,
                    DateTime?Created,
                    String SOC,
                    String InternalSOC,
                    String PurchaseOrder,
                    Provider_Id?Provider,
                    String ProviderTariff,
                    String ProviderPrice,
                    DateTime?ProviderStartDate)
 {
     this.CLI               = CLI;
     this.SIMNumber         = SIMNumber;
     this.Description       = Description;
     this.InventoryRef      = InventoryRef;
     this.State             = State;
     this.Version           = Version;
     this.ActorStatus       = ActorStatus;
     this.ForeignAttributes = ForeignAttributes;
     this.Tariff            = Tariff;
     this.Bundle            = Bundle;
     this.Operator          = Operator;
     this.Hints             = Hints;
     this.NetworkStatus     = NetworkStatus;
     this.Created           = Created;
     this.SOC               = SOC;
     this.InternalSOC       = InternalSOC;
     this.PurchaseOrder     = PurchaseOrder;
     this.Provider          = Provider;
     this.ProviderTariff    = ProviderTariff;
     this.ProviderPrice     = ProviderPrice;
     this.ProviderStartDate = ProviderStartDate;
 }
예제 #2
0
 public IOTDevice(CLI CLI,
                  SIM_Id?SIMNumber,
                  String SOC,
                  String InternalSOC,
                  String Description,
                  IIPAddress IPAddress,
                  DateTime?StartDate,
                  DateTime?EndDate,
                  String FriendlyName,
                  String Hints,
                  String ProvisioningMetaData,
                  Byte?Status,
                  Byte?Version,
                  Byte?ActorStatus,
                  Byte?NetworkStatus,
                  Boolean?Enabled,
                  Boolean?LockIMEI,
                  String IMEI,
                  DateTime?LastSync,
                  Last_Connected?LastConnected_Start)
 {
     this.CLI                  = CLI;
     this.SIMNumber            = SIMNumber;
     this.SOC                  = SOC;
     this.InternalSOC          = InternalSOC;
     this.Description          = Description;
     this.IPAddress            = IPAddress;
     this.StartDate            = StartDate;
     this.EndDate              = EndDate;
     this.FriendlyName         = FriendlyName;
     this.Hints                = Hints;
     this.ProvisioningMetaData = ProvisioningMetaData;
     this.Status               = Status;
     this.Version              = Version;
     this.ActorStatus          = ActorStatus;
     this.NetworkStatus        = NetworkStatus;
     this.Enabled              = Enabled;
     this.LockIMEI             = LockIMEI;
     this.IMEI                 = IMEI;
     this.LastSync             = LastSync;
     this.LastConnected        = LastConnected;
 }
예제 #3
0
        public static Boolean TryParseAsavie(JObject JSON, out IOTDevice IOTDevice)
        {
            #region Documentation

            // GetIOTDevices:
            // {
            //    "CLI":                    "204043729927975",
            //    "SIMNumber":              "89314404000132906315",
            //    "SOC":                    null,
            //    "InternalSOC":            "iot",
            //    "Description":            null,
            //    "IPAddress":              "10.20.0.3",
            //    "StartDate":              "2018-06-20T11:13:47.4048154Z",
            //    "EndDate":                "0001-01-01T00:00:00",
            //    "FriendlyName":           "oem-204043729927975",
            //    "Hints":                  null,
            //    "ProvisioningMetaData":   null,
            //    "Status":                 1,
            //    "Version":                5,
            //    "ActorStatus":            0,
            //    "NetworkStatus":          0,
            //    "Enabled":                true,
            //    "LockIMEI":               false,
            //    "IMEI":                   null,
            //    "LastSync":               "2018-06-20T11:13:47.5767265Z",
            //    "LastConnected_Start":    null,
            //    "LastConnected_End":      null,
            //    "LastConnected_MCC":      "",
            //    "LastConnected_MNC":      ""
            // }

            #endregion

            try
            {
                var EndDate       = new DateTime?();
                var EndDateString = JSON["EndDate"]?.Value <String>();
                if (EndDateString.IsNotNullOrEmpty())
                {
                    if (EndDateString == "0001-01-01T00:00:00" ||
                        EndDateString == "01/01/0001 00:00:00")
                    {
                        EndDate = null;
                    }

                    else
                    {
                        EndDate = JSON["EndDate"]?.Value <DateTime>();
                    }
                }

                IOTDevice = new IOTDevice(CLI.Parse(JSON["CLI"].Value <String>()),
                                          JSON["SIMNumber"]?.Value <String>().IsNotNullOrEmpty() == true
                                               ? new SIM_Id?(SIM_Id.Parse(JSON["SIMNumber"].Value <String>()))
                                               : null,
                                          JSON["SOC"]?.Value <String>(),
                                          JSON["InternalSOC"]?.Value <String>(),
                                          JSON["Description"]?.Value <String>(),
                                          JSON["IPAddress"]?.Value <String>().IsNotNullOrEmpty() == true
                                               ? org.GraphDefined.Vanaheimr.Hermod.IPAddress.Parse(JSON["IPAddress"]?.Value <String>())
                                               : null,
                                          JSON["StartDate"]?.Value <DateTime>(),
                                          EndDate,
                                          JSON["FriendlyName"]?.Value <String>(),
                                          JSON["Hints"]?.Value <String>(),
                                          JSON["ProvisioningMetaData"]?.Value <String>(),
                                          JSON["Status"]?.Value <Byte>(),
                                          JSON["Version"]?.Value <Byte>(),
                                          JSON["ActorStatus"]?.Value <Byte>(),
                                          JSON["NetworkStatus"]?.Value <Byte>(),
                                          JSON["Enabled"]?.Value <Boolean>(),
                                          JSON["LockIMEI"]?.Value <Boolean>(),
                                          JSON["IMEI"]?.Value <String>(),
                                          JSON["LastSync"]?.Value <DateTime>(),
                                          JSON["LastConnected_Start"] is JObject
                                               ? new Last_Connected?(new Last_Connected(JSON["LastConnected_Start"].Value <DateTime>(),
                                                                                        EndDate,
                                                                                        JSON["LastConnected_MCC"]?.Value <String>(),
                                                                                        JSON["LastConnected_MNC"]?.Value <String>()))
                                               : null);

                return(true);
            }
            catch (Exception)
            { }

            IOTDevice = null;
            return(false);
        }