public void RetrieveDoors(string zone) { string sql = String.Format(SelectString, SelectArgValues); var results = QueryHelper.TryRunQuery(_connection, sql); if (results != null) { Door door; foreach (Dictionary<string, object> row in results) { door = new Door(_queryConfig); door.SetProperties(Queries, row); door.Created(); Doors.Add(door); } } }
public Door DoorFactory() { Door door = null; int id = 0; int doorid = 0; if (Doors.Count > 0) { id = Doors.Max(x => x.Id) + 1; doorid = Doors.Max(x => x.DoorId) + 1; } door = new Door(_queryConfig); door.Id = id; door.DoorId = doorid; door.Zone = Zone; door.Created(); return door; }