public ResourceCatalog GetByDate(DateTime startDate, DateTime endDate) { List <Guid> timeSeriesGuidList = new List <Guid>(); List <Guid> documentGuidList = new List <Guid>(); ResourceCatalog resCat = new ResourceCatalog(); DataTable dt = new DataTable(); DateTime nullDate = new DateTime(); if (startDate == nullDate && endDate == nullDate) { dt = resCat.GetEntireByDate(); } else if (endDate == nullDate) { dt = resCat.GetByStartDate(startDate); } else if (startDate == nullDate) { dt = resCat.GetByEndDate(endDate); } else { dt = resCat.GetBetweenDates(startDate, endDate); } foreach (DataRow row in dt.Rows) { int resourceTypeId = Convert.ToInt16(row["resourcetype"].ToString()); if (resourceTypeId == 1) { Guid timeGuid = new Guid(row["resourceid"].ToString()); timeSeriesGuidList.Add(timeGuid); } else { Guid docGuid = new Guid(row["resourceid"].ToString()); documentGuidList.Add(docGuid); } } foreach (Guid g in timeSeriesGuidList) { TimeSeriesResource tm = new TimeSeriesResource(); tm = tm.GetTimeSeriesObjectbyDataGuid(g); resCat.timeSeriesCatalog.Add(tm); } foreach (Guid g in documentGuidList) { Document doc = new Document(); doc = doc.GetDocumentById(g); resCat.documentCatalog.Add(doc); } return(resCat); }