Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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;
        }