示例#1
0
        /// <summary>
        /// Search all tickets by datetime.
        /// </summary>
        /// <returns>The collection of tickets</returns>
        //public IEnumerable<Domain.Models.Tickets> GetTicketsByDatetime(string datetime)
        //{

        //}

        /// <summary>
        /// Get a store by id.
        /// </summary>
        /// <param int="storeId">The ID of the store</param>
        /// <returns>The store</returns>
        public async Task <Domain.Models.Stores> GetStoreByIdAsync(int storeId)
        {
            Entities.Stores item = await _dbContext.Stores
                                   .FirstOrDefaultAsync(s => s.Id == storeId);

            return(Mapper.MapStores(item));
        }
示例#2
0
        public static YourStore.Library.Store MapStore(Entities.Stores st)
        {
            YourStore.Library.Store store = new Store();
            store.Name    = st.StoreName;
            store.StoreID = st.Id;
            store.Zip     = st.Zip;
            YourStore.Library.Product products = new YourStore.Library.Product();

            foreach (Entities.Inventories inven in st.Inventories)
            {
                products = Mapper.MapProduct(inven.Product);
                store.ItemInventory.Add(products, inven.Quantity);
            }


            return(store);
        }
示例#3
0
        public static Entities.Stores MapStore(YourStore.Library.Store st)
        {
            Entities.Stores stor = new Entities.Stores();

            stor.StoreName = st.Name;
            stor.Id        = st.StoreID;
            stor.Zip       = st.Zip;

            /* foreach (YourStore.Library.Products p in st.ItemInventory.Keys)
             * {
             *
             *   Entities.Products products = Mapper.MapProduct(p);
             *   Entities.Inventories x = new Entities.Inventories();
             *   x.Product = products;
             *   x.Quantity = st.ItemInventory[p];
             *   stor.Inventories.Add(x);
             *
             * }*/

            return(stor);
        }