Esempio n. 1
0
        public IEnumerable <ProductsGroup> GetGemachProductsGroupsByGemachId(int gemachid)
        {
            Gemach gemach = gemaches.Find(g => g.GemachId == gemachid);
            IEnumerable <ProductsGroup> retVal = gemach.GemachProductsGroups;

            return(retVal);
        }
Esempio n. 2
0
        public IEnumerable <GemachManager> GetGemachManagersByGemachId(int gemachid)
        {
            Gemach gemach = gemaches.Find(g => g.GemachId == gemachid);
            IEnumerable <GemachManager> retVal = gemach.GemachManagers;

            return(retVal);
        }
Esempio n. 3
0
        public GemachManager GetGemachManagerByGemachIdAndManagerId(int gemachid, int managerid)
        {
            Gemach        gemach = gemaches.Find(g => g.GemachId == gemachid);
            GemachManager retVal = gemach.GemachManagers.Find(gc => gc.GemachManagerId == managerid);

            return(retVal);
        }
Esempio n. 4
0
        public Customer GetGemachCustomerByGemachIdAndCustomerId(int gemachid, int customerid)
        {
            Gemach   gemach = gemaches.Find(g => g.GemachId == gemachid);
            Customer retVal = gemach.GemachCustomers.Find(gc => gc.CustomerId == customerid);

            return(retVal);
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Category,Name,Description,City,Community,OwnerFirstName,OwnerLastName,PhoneNumber")] Gemach gemach)
        {
            if (id != gemach.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(gemach);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GemachExists(gemach.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(gemach));
        }
Esempio n. 6
0
        public Product GetGemachProductsGroupProductByGemachIdAndProductsGroupIdAndProductId(int gemachid, int productsgroupid, int productid)
        {
            Gemach        gemach        = gemaches.Find(g => g.GemachId == gemachid);
            ProductsGroup productsGroup = gemach.GemachProductsGroups.Find(gpg => gpg.ProductsGroupId == productsgroupid);
            Product       retVal        = productsGroup.ProductGroupProducts.Find(gpgp => gpgp.ProductId == productid);

            return(retVal);
        }
Esempio n. 7
0
        public IEnumerable <Product> GetGemachProductsGroupsProductsByGemachIdAndProductsGroup(int gemachid, int productsgroupid)
        {
            Gemach                gemach        = gemaches.Find(g => g.GemachId == gemachid);
            ProductsGroup         productsGroup = gemach.GemachProductsGroups.Find(gpg => gpg.ProductsGroupId == productsgroupid);
            IEnumerable <Product> retVal        = productsGroup.ProductGroupProducts;

            return(retVal);
        }
Esempio n. 8
0
        public async Task <IActionResult> Create([Bind("ID,Category,Name,Description,City,Community,OwnerFirstName,OwnerLastName,PhoneNumber")] Gemach gemach)
        {
            if (ModelState.IsValid)
            {
                _context.Add(gemach);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(gemach));
        }