コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }