public ZonePointsDatabase(string zone, MySqlConnection connection, QueryConfig config) : base(zone,config) { _connection = connection; string sql = String.Format(SelectString, SelectArgValues); var results = QueryHelper.RunQuery(_connection, sql); ZonePoint zp; if (results != null) { foreach (Dictionary<string, object> row in results) { zp = new ZonePoint(_queryConfig); zp.SetProperties(Queries, row); zp.Created(); Points.Add(zp); } } Created(); }
public ZonePoint Create() { ZonePoint zp = new ZonePoint(_queryConfig); zp.Zone = Zone; if (_zonePoints.Count > 0) { zp.Number = _zonePoints.Max(x => x.Number) + 1; } else zp.Number = 1; zp.Created(); Add(zp); return zp; }