public static TrackerItem GetForUser(int userID, long JNPID) { TrackerItem trackerItem = null; try { DataTable dataTable = ExecuteDataTable("spr_GetTrackerItemByID", userID, JNPID); if (dataTable.Rows.Count == 1) { DataRow dataRow = dataTable.Rows[0]; if (dataRow != null) { trackerItem = new TrackerItem(dataRow); } } } catch (Exception ex) { trackerItem = null; ExceptionBase.HandleException(ex); } return(trackerItem); }
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); }