/// <summary> /// Gets the unique instance of the Station configuration class /// </summary> /// <returns></returns> public static StationConfiguration GetInstance() { if (instance == null) { instance = new StationConfiguration(); } return(instance); }
private string GetPhysicalLocation() { string result = StationConfiguration.GetInstance().StationPhysicalLocation; if (result == null) { result = string.Empty; } return(result); }
/// <summary> /// Add the parameters for the update and insert queries /// </summary> /// <param name="command"></param> private void AddParameters(SqlCommand command) { command.Parameters.AddWithValue("@ip", GetIP()); command.Parameters.AddWithValue("@version", GetVersion()); command.Parameters.AddWithValue("@description", GetPhysicalLocation()); command.Parameters.AddWithValue("@user", System.Security.Principal.WindowsIdentity.GetCurrent().Name); command.Parameters.AddWithValue("@has_vnc", StationConfiguration.GetInstance().StationVNCAvailable); command.Parameters.AddWithValue("@type", GetType()); command.Parameters.AddWithValue("@last_version_update", DateTime.Now); command.Parameters.AddWithValue("@carrier", string.Empty); command.Parameters.AddWithValue("@oem", string.Empty); command.Parameters.AddWithValue("@model", string.Empty); command.Parameters.AddWithValue("@test_equipment_sn", Valutech.RF.Agilent.GetSN()); command.Parameters.AddWithValue("@wks", this.workstation); command.Parameters.AddWithValue("@is_admin", new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator)); }