コード例 #1
0
ファイル: Gateway.cs プロジェクト: WilliamCopland/YPILIS
        public static Business.ReportDistribution.Model.ReportDistributionLogEntryCollection GetReportDistributionLogEntryCollectionGTETime(DateTime startTime)
        {
            Business.ReportDistribution.Model.ReportDistributionLogEntryCollection result = new ReportDistribution.Model.ReportDistributionLogEntryCollection();

            YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(Business.Mongo.TestServer.LISDatabaseName);
            MongoCollection collection = server.Database.GetCollection<BsonDocument>("ReportDistributionLogEntry");

            BsonDateTime bsonStartDate = BsonDateTime.Create(startTime);
            MongoCursor cursor = collection.FindAs<BsonDocument>(Query.GTE("Date", bsonStartDate.ToUniversalTime()));

            foreach (BsonDocument bsonDocument in cursor)
            {
                YellowstonePathology.Business.ReportDistribution.Model.ReportDistributionLogEntry reportDistributionLogEntry = new ReportDistribution.Model.ReportDistributionLogEntry();
                YellowstonePathology.Business.Mongo.BSONPropertyWriter.Write(bsonDocument, reportDistributionLogEntry);
                result.Add(reportDistributionLogEntry);
            }

            return result;
        }
コード例 #2
0
ファイル: Gateway.cs プロジェクト: waffle-iron/YPILIS
        public static Business.ReportDistribution.Model.ReportDistributionLogEntryCollection GetReportDistributionLogEntryCollectionGTETime(DateTime startTime)
        {
            Business.ReportDistribution.Model.ReportDistributionLogEntryCollection result = new ReportDistribution.Model.ReportDistributionLogEntryCollection();

            YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(Business.Mongo.TestServer.LISDatabaseName);
            MongoCollection collection = server.Database.GetCollection <BsonDocument>("ReportDistributionLogEntry");

            BsonDateTime bsonStartDate = BsonDateTime.Create(startTime);
            MongoCursor  cursor        = collection.FindAs <BsonDocument>(Query.GTE("Date", bsonStartDate.ToUniversalTime()));

            foreach (BsonDocument bsonDocument in cursor)
            {
                YellowstonePathology.Business.ReportDistribution.Model.ReportDistributionLogEntry reportDistributionLogEntry = new ReportDistribution.Model.ReportDistributionLogEntry();
                YellowstonePathology.Business.Mongo.BSONPropertyWriter.Write(bsonDocument, reportDistributionLogEntry);
                result.Add(reportDistributionLogEntry);
            }

            return(result);
        }