public static UserObjectCollection DataTableToCollection(DataTable users) { UserObjectCollection objectsTotal; UserObjectCollection objects = new UserObjectCollection(); try { IEnumerator enumerator = null; try { enumerator = users.Rows.GetEnumerator(); while (enumerator.MoveNext()) { DataRow current = (DataRow)enumerator.Current; objects.Add(UserRowToObject(current)); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } objectsTotal = objects; } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } return(objectsTotal); }
public void FindAll() { try { UserObjectCollection users = new UserObjectCollection(); users = new TIS.BL.Internal.User().GetAll(); gdcUsers.DataSource = users; } catch (System.Exception exception1) { throw new System.Exception(MethodBase.GetCurrentMethod().Name, exception1); } }
public UserObjectCollection GetAll() { UserObjectCollection users = new UserObjectCollection(); string str = ""; try { str = this.BaseQuery(false, 0) + " ORDER BY " + UserObject.SURNAME + " "; users = UserConvertor.DataTableToCollection(this.ExecuteDataSet(str, false).Tables[0]); } catch (System.Exception exception1) { throw new Exception(MethodBase.GetCurrentMethod().Name, exception1); } return users; }