public static Thermostat LoadThermostat(int locationId, string ipAddress)
        {
            Thermostats thermostats = Thermostats.LoadThermostats("SELECT * FROM Thermostats WHERE LocationId=@LocationId AND IpAddress=@IpAddress", CommandType.Text, new SqlParameter[] { new SqlParameter("@LocationId", locationId), new SqlParameter("@IpAddress", ipAddress) });

            if (thermostats.Count == 0)
            {
                return(null);
            }
            else
            {
                return(thermostats[0]);
            }
        }
        public static Thermostat LoadByKeyName(string keyName)
        {
            Thermostats thermostats = Thermostats.LoadThermostats("SELECT * FROM Thermostats WHERE KeyName=@KeyName", CommandType.Text, new SqlParameter[] { new SqlParameter("@KeyName", keyName) });

            if (thermostats.Count == 0)
            {
                return(null);
            }
            else
            {
                return(thermostats[0]);
            }
        }
 public static Thermostats LoadThermostatsByLocationId(System.Int32 locationId)
 {
     return(Thermostats.LoadThermostats("LoadThermostatsByLocationId", CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@LocationId", locationId) }));
 }
 public static Thermostats LoadAllThermostats()
 {
     return(Thermostats.LoadThermostats("LoadThermostatsAll", CommandType.StoredProcedure, null));
 }
Beispiel #5
0
 public static Thermostats LoadThermostatsByLocationId(int locationId)
 {
     return(Thermostats.LoadThermostats("thermostats_load_by_location_id", CommandType.StoredProcedure, new MySqlParameter[] { new MySqlParameter("@location_id", locationId) }));
 }