/// <summary> Получает все объекты из таблицы, отвечающие заданным условиям </summary> /// <param name="entity">Сущность</param> /// <param name="Where">Условия</param> /// <returns>Массив объектов</returns> public DBObject[] GetObjects(DBEntity entity, string Where = "") { DataTable table; string TablesNames = entity.Name; table = base.Select(TablesNames, Where); DBObject[] Result = new DBObject[table.Rows.Count]; for (int I = 0; I < table.Rows.Count; I++) { Result[I] = DBObject.GetDBObject(entity, table.Rows[I]); } return(Result); }
/// <summary> Получает объект по его ИД </summary> /// <param name="entity">Сущность</param> /// <param name="ID">ИД</param> /// <returns>Объект</returns> public DBObject GetObject(DBEntity entity, int ID) { DataTable table = base.Select( entity.Name, "ID=" + ID.ToString() ); if (table.Rows.Count > 0) { return(DBObject.GetDBObject(entity, table.Rows[0])); } else { throw new ArgumentOutOfRangeException(entity.TranslationName + " ID"); } }