public List <Station> GetStationsByUser(User user) { List <Station> stations = new List <Station>(); SensorAddress address = new SensorAddress(); address.UserName = user.Name; MySqlParameter[] parms = new MySqlParameter[] { new MySqlParameter("@address", user.Name + ".%") }; string cmdText = "select * from station where address like @address"; MySqlDataReader reader = base.MySqlHelper.ExecuteReader(cmdText, parms); while (reader.Read()) { Station station = new Station(); station.Name = reader[0].ToString().Trim(); station.Address = new SensorAddress(reader[1].ToString().Trim()); station.Description = reader[2].ToString().Trim(); stations.Add(station); } this.mySqlHelper.CloseConn(); return(stations); }
public Station(string name, SensorAddress address, string description, int moduleCount) { this.name = name; this.address = address; this.description = description; this.ModuleCount = moduleCount; }
public Module(string name, SensorAddress address, string description, int anaSensorCount, int digSensorCount) { this.Name = name; this.Address = address; this.Description = description; this.AnaSensorCount = anaSensorCount; this.DigSensorCount = digSensorCount; }