public static TrackerItemCollection GetCollectionForUser(int userID) { TrackerItemCollection collection = null; try { DataTable table = ExecuteDataTable("spr_GetAllTrackerItemByUserID", userID); // fill collection list collection = TrackerItem.GetCollection(table); } catch (Exception ex) { HandleException(ex); } return(collection); }
private static TrackerItemCollection GetCollection(DataTable table) { TrackerItemCollection collection = new TrackerItemCollection(); try { if (table != null) { for (int i = 0; i < table.Rows.Count; i++) { TrackerItem item = new TrackerItem(table.Rows[i]); collection.Add(item); } } } catch (Exception ex) { HandleException(ex); } return(collection); }
protected void jnpTrackerGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { TrackerItemCollection collection = TrackerItem.GetCollectionForUser(CurrentUserID); jnpTrackerGrid.DataSource = collection; }