private static BidMessage get_message_by_bid_and_supplier(Int64 bidId, Int64 supplierId)
        {
            var qry = new Query(BidMessage.TableSchema);

            qry.Where(BidMessage.Columns.BidId, bidId);
            qry.AddWhere(BidMessage.Columns.SupplierId, supplierId);
            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    BidMessage item = new BidMessage();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
        public static List <BidMessage> GetAllMessagesByBidId(long bidId)
        {
            var qry = new Query(BidMessage.TableSchema);

            qry.AddWhere(BidMessage.Columns.BidId, WhereComparision.EqualsTo, bidId);
            var messageList = new List <BidMessage>();

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                while (reader.Read())
                {
                    BidMessage item = new BidMessage();
                    item.Read(reader);
                    messageList.Add(item);
                }
            }
            return(messageList);
        }
        internal static List <BidMessage> GetAllRelevantMessages(DateTime now)
        {
            var qry = new Query(BidMessage.TableSchema);

            qry.Where(BidMessage.Columns.IsActive, true);
            qry.AddWhere(BidMessage.Columns.ExpirationTime, WhereComparision.LessThan, now);
            var messageList = new List <BidMessage>();

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                while (reader.Read())
                {
                    BidMessage item = new BidMessage();
                    item.Read(reader);
                    messageList.Add(item);
                }
            }
            return(messageList);
        }