Ejemplo n.º 1
0
        public static RBCTimeData[] GetRBCTimeEntries(DateTime fromDate, DateTime toDate, SortOrder sortOrder)
        {
            //throw new NotImplementedException();
            using (var db = new RBCTimeDataContext()) {
                try {
                    var rtd = from x in db.RBCTimeDataItems
                              where x.Date >= fromDate && x.Date <= toDate
                              orderby x.Date
                              select x;

                    return(!rtd.Any() ? null : rtd.Select(i => RBCTimeData.Copy(i)).ToArray());
                } catch { return(null); }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the RBC Time Data for a given itemID.
 /// </summary>
 /// <param name="itemID">The item ID to look up.</param>
 /// <returns>The time data for the given item id.</returns>
 public static RBCTimeData GetRBCTimeData(int itemID)
 {
     //
     if (itemID < 0)
     {
         return(null);
     }
     using (var db = new RBCTimeDataContext()) {
         try {
             var rtd = db.RBCTimeDataItems.Single(s => s.ItemId == itemID);
             if (rtd == null)
             {
                 return(null);
             }
             return(RBCTimeData.Copy(rtd));
         } catch {
             return(null);
         }
     }
 }