Beispiel #1
0
        public async Task <ItemDataContract> GetItemByIdAsync(int itemId)
        {
            GetShopDBData    dbRepository     = new GetShopDBData();
            ItemDataContract itemDataContract = new ItemDataContract();

            itemDataContract = dbRepository.GetItemById(itemId);
            return(itemDataContract);
        }
Beispiel #2
0
        //public bool InsertOrUpdateItem(Item item)
        //{
        //    context.ItemSet.Add(item);

        //    return true;
        //}

        //public List<Shop> GetShops()
        //{
        //    List<Shop> shops = new List<Shop>();
        //    try
        //    {
        //        shops = context.ShopSet.ToList();
        //    }
        //    catch (Exception ex)
        //    {

        //        throw ex;
        //    }
        //    return shops;
        //}

        //public async Task<List<Shop>> GetShopsAsync()
        //{
        //    return await context.ShopSet.ToListAsync();
        //}

        //public bool InsertOrUpdateShop(Shop shop)
        //{
        //    context.ShopSet.Add(shop);
        //    return true;
        //}

        //public List<Price> GetPrices()
        //{
        //    return context.PriceSet.ToList();
        //}

        public List <PriceDataContract> GetPricesByItem(int?itemId)
        {
            GetShopDBData dbRepository = new GetShopDBData();

            List <PriceDataContract> prices = new List <PriceDataContract>();

            try
            {
                prices = dbRepository.GetPricesByItem(itemId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(prices);
            //context.PriceSet.Where(x => x.ItemId == itemId).ToList();
        }
Beispiel #3
0
        public ShopDataContract UpdateShop(ShopDataContract shopDataContract)
        {
            GetShopDBData dBRepository = new GetShopDBData();

            bool retVal = false;


            try
            {
                retVal = dBRepository.UpdateShop(shopDataContract);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(shopDataContract);
        }
Beispiel #4
0
        public List <ShopDataContract> GetShops()
        {
            GetShopDBData dBRepository = new GetShopDBData();

            List <ShopDataContract> shops = new List <ShopDataContract>();


            try
            {
                shops = dBRepository.GetShops();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(shops);
        }
Beispiel #5
0
        //BeforeBuyingContainer context = null;

        //public DBRepository2()
        //{
        //    context = new BeforeBuyingContainer();
        //}

        public async Task <List <ItemDataContract> > GetAllItemsAsync(/*int id*/)
        {
            GetShopDBData dbRepository = new GetShopDBData();

            List <ItemDataContract> items = new List <ItemDataContract>();

            try
            {
                items = dbRepository.getItems();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(items);
            //    context.ItemSet.ToListAsync();
            //return context.ItemSet.Select(x => x).ToList();
        }