예제 #1
0
        private static UserDashShoppingCart MapUserDashShoppingCart(IDataReader reader, out int startingIndex)
        {
            UserDashShoppingCart aUserDashShoppingCart = new UserDashShoppingCart();

            startingIndex = 0;

            aUserDashShoppingCart.Id           = reader.GetSafeInt32(startingIndex++);
            aUserDashShoppingCart.ProductId    = reader.GetSafeInt32(startingIndex++);
            aUserDashShoppingCart.Quantity     = reader.GetSafeInt32(startingIndex++);
            aUserDashShoppingCart.DateCreated  = reader.GetSafeDateTime(startingIndex++);
            aUserDashShoppingCart.DateModified = reader.GetSafeDateTime(startingIndex++);
            aUserDashShoppingCart.CreatedBy    = reader.GetSafeInt32(startingIndex++);

            return(aUserDashShoppingCart);
        }
예제 #2
0
        public List <UserDashShoppingCart> GetTopShoppingCartItems()
        {
            List <UserDashShoppingCart> list = null;

            string procName = "dbo.ShoppingCart_SelectTopFive";

            _data.ExecuteCmd(procName, inputParamMapper : null
                             , singleRecordMapper : delegate(IDataReader reader, short set)
            {
                UserDashShoppingCart aUserDashShoppingCart = MapUserDashShoppingCart(reader, out int index);

                if (list == null)
                {
                    list = new List <UserDashShoppingCart>();
                }

                list.Add(aUserDashShoppingCart);
            }
                             );

            return(list);
        }