public static ArrayList GetObjectCollection(DataTable dt, System.Type type, string tableName) { type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic); ArrayList arrayList = new ArrayList(); foreach (DataRow row in (InternalDataCollectionBase)dt.Rows) { arrayList.Add(SqlDatabaseHelper.GetObjectFromDataRow(row, type)); } return(arrayList); }
public virtual List <BusinessObject> GetListBusinessObjects() { List <BusinessObject> businessObjectList = new List <BusinessObject>(); DataSet allObjects = this.GetAllObjects(); if (allObjects.Tables.Count > 0) { foreach (DataRow row in (InternalDataCollectionBase)allObjects.Tables[0].Rows) { BusinessObject objectFromDataRow = (BusinessObject)SqlDatabaseHelper.GetObjectFromDataRow(row, this.dal.ObjectType); businessObjectList.Add(objectFromDataRow); } } return(businessObjectList); }
public static object GetSingleObject(DataTable dt, System.Type type) { try { if (dt.Rows.Count <= 0) { return((object)null); } return(SqlDatabaseHelper.GetObjectFromDataRow(dt.Rows[0], type)); } catch (Exception ex) { throw; } }
public object GetObjectFromDataRow(DataRow row) { return(SqlDatabaseHelper.GetObjectFromDataRow(row, this.ObjectType)); }