예제 #1
0
        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);
        }
예제 #2
0
 public Station(string name, SensorAddress address, string description, int moduleCount)
 {
     this.name        = name;
     this.address     = address;
     this.description = description;
     this.ModuleCount = moduleCount;
 }
예제 #3
0
파일: Module.cs 프로젝트: jimesking/SCSM
 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;
 }