/// <summary> /// Records the device info. /// </summary> /// <param name="location">Location.</param> /// <param name="serialNumber">Serial number.</param> /// <param name="modelName">Name of the model.</param> /// <param name="ipAddress">IP address.</param> /// <param name="deviceId">Device id.</param> /// <param name="url">URL.</param> /// <remarks> /// Sequence Diagram:<br/> /// <img src="SequenceDiagrams/SD_DataManagerMFP.Controller.MFP.RecordDeviceInfo.jpg"/> /// </remarks> public static string RecordDeviceInfo(string location, string serialNumber, string modelName, string ipAddress, string deviceId, string accessAddress, bool isEAMEnabled) { string hostName = string.Empty; try { IPHostEntry IpToDomainName = Dns.GetHostEntry(ipAddress); hostName = IpToDomainName.HostName; } catch (Exception ex) { hostName = ipAddress; } string returnValue = string.Empty; try { using (OsaDirectEAManager.Database database = new OsaDirectEAManager.Database()) { location = location == null ? "" : location; serialNumber = serialNumber == null ? "" : serialNumber; modelName = modelName == null ? "" : modelName; ipAddress = ipAddress == null ? "" : ipAddress; deviceId = deviceId == null ? "" : deviceId; accessAddress = accessAddress == null ? "" : accessAddress; ArrayList spParameters = new ArrayList();//Create an Array List //Set argument data for Stored Procedure database.spArgumentsCollection(spParameters, "@location", location, "nvarchar"); database.spArgumentsCollection(spParameters, "@serialNumber", serialNumber, "nvarchar"); database.spArgumentsCollection(spParameters, "@modelName", modelName, "nvarchar"); database.spArgumentsCollection(spParameters, "@ipAddress", ipAddress, "nvarchar"); database.spArgumentsCollection(spParameters, "@hostName", hostName, "nvarchar"); database.spArgumentsCollection(spParameters, "@deviceId", deviceId, "nvarchar"); database.spArgumentsCollection(spParameters, "@accessAddress", accessAddress, "nvarchar"); database.spArgumentsCollection(spParameters, "@isEAMEnabled", isEAMEnabled.ToString(), "bit"); //run stored procedure. database.RunStoredProcedure(database.Connection.ConnectionString, "RecordHelloEvent", spParameters); } } catch (Exception ex) { throw; } return(returnValue); }