/// <summary> /// Creates a new device on the Device table in the DB /// If the Device ID is null or an empty string the device is new and we can attempt to create a new device, otherwise it is not new and we should pass /// </summary> /// <returns>The number of items added to the tatabase or if return value -1 indicates that the devices can not be created /// or that an error in the insert happend</returns> public int CreateNewDevice() { if (IsNew) { return(-1); } else { Data_Broker DB = new Data_Broker(); return(DB.InsertNewDevice(DeviceName, IMEI, SerialNumber)); } }
/// <summary> /// Creates a new device on the Device table in the DB /// If the Device ID is null or an empty string the device is new and we can attempt to create a new device, otherwise it is not new and we should pass /// </summary> /// <param name="D_Name"></param> /// <param name="Imei"></param> /// <param name="SerialNumber"></param> /// <returns>The number of items added to the tatabase or if return value -1 indicates that the devices can not be created /// or that an error in the insert happend</returns> public int CreateNewDevice(string D_Name, string Imei, string SerialNumber) { if (IsNew) { if (string.IsNullOrEmpty(D_Name)) { return(-1); } else { IsNew = false; Data_Broker DB = new Data_Broker(); return(DB.InsertNewDevice(D_Name, Imei, SerialNumber)); } } else { return(-1); } }
/// <summary> /// Adds a new device to the database (this is a striped down device that can not be used until added to Octave) /// New devices are only added when provisioning /// </summary> /// <param name="DeviceName">The name of the device on the Octave platform. NOTE this name can not be changed in OCTAVE once it has been set</param> /// <param name="Imei">The IMEI number of the device</param> /// <param name="SerialNumber">The Sierrawireless Serial number</param> /// <returns></returns> public int AddNewOctaveDevice(string DeviceName, string Imei, string SerialNumber) { Data_Broker DB = new Data_Broker(); return(DB.InsertNewDevice(DeviceName, Imei, SerialNumber)); }