예제 #1
0
        public OrderCollection FetchByQuery(Query qry)
        {
            OrderCollection coll = new OrderCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
예제 #2
0
        public OrderCollection FetchAll()
        {
            OrderCollection coll = new OrderCollection();
            Query           qry  = new Query(Order.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
예제 #3
0
        /// <summary>
        /// Fetches the associated orders.
        /// </summary>
        /// <param name="orderId">The order id.</param>
        /// <returns></returns>
        public OrderCollection FetchAssociatedOrders(int orderId)
        {
            IDataReader     reader          = SPs.FetchAssociatedOrders(orderId).GetReader();
            OrderCollection orderCollection = new OrderCollection();

            orderCollection.LoadAndCloseReader(reader);
            orderCollection.Sort(Order.Columns.CreatedOn, true);
            return(orderCollection);
        }
예제 #4
0
        /// <summary>
        /// Fetches the orders for user.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <returns></returns>
        public OrderCollection FetchOrdersForUser(string userName)
        {
            IDataReader reader = new Query(Order.Schema).
                                 AddWhere(Order.Columns.UserName, Comparison.Equals, userName).
                                 AddWhere(Order.Columns.OrderStatusDescriptorId, Comparison.NotEquals, (int)OrderStatus.NotProcessed).
                                 ExecuteReader();
            OrderCollection orderCollection = new OrderCollection();

            orderCollection.LoadAndCloseReader(reader);
            return(orderCollection);
        }