public List <OrderBasketViewModel> GetPubOrderBasketItems(int OrderBasketID)
        {
            var results = GetPubOrderBasketItemsResults.FromSqlRaw("EXEC Get_PubOrderBasketItems @OrderBasketID",
                                                                   new SqlParameter("@OrderBasketID", OrderBasketID)).ToList();

            if (results.Count() > 0)
            {
                List <OrderBasketViewModel> OrderBasket = new List <OrderBasketViewModel>();
                foreach (Get_PubOrderBasketItemsViewModel item in results)
                {
                    OrderBasket.Add(new OrderBasketViewModel()
                    {
                        ItemQuantity = item.ItemQuantity,
                        PubItem      = new PubItems()
                        {
                            ItemDescription = item.ItemDescription,
                            ItemId          = item.ItemId,
                            ItemImagePath   = item.ItemImagePath,
                            ItemName        = item.ItemName,
                            ItemOnSale      = item.ItemOnSale,
                            ItemPrice       = item.ItemPrice,
                            ItemStock       = item.ItemStock,
                            ItemType        = PubItemType.GetItemType(item.ItemType)
                        }
                    });
                }
                //If results are returned then the user has been found. As the user is unique, their will only be one result so the password is fetched from the first (only) result.
                return(OrderBasket);
            }
            else
            {
                return(null); //no results returned - user ID dosen't exist in DB so give nothing.
            }
        }
 private static PubItems ConvertItemResultsToPubItems(Get_PubItemsViewModel item)
 {
     return(new PubItems()
     {
         ItemId = item.ItemId,
         ItemName = item.ItemName,
         ItemDescription = item.ItemDescription,
         ItemImagePath = item.ItemImagePath,
         ItemOnSale = Convert.ToBoolean(item.ItemOnSale),
         ItemPrice = item.ItemPrice,
         ItemStock = item.ItemStock,
         ItemType = PubItemType.GetItemType(item.ItemType)
     });
 }