コード例 #1
0
ファイル: GemachesController.cs プロジェクト: 4199918/Gemachs
        public IEnumerable <ProductsGroup> GetGemachProductsGroupsByGemachId(int gemachid)
        {
            Gemach gemach = gemaches.Find(g => g.GemachId == gemachid);
            IEnumerable <ProductsGroup> retVal = gemach.GemachProductsGroups;

            return(retVal);
        }
コード例 #2
0
ファイル: GemachesController.cs プロジェクト: 4199918/Gemachs
        public IEnumerable <GemachManager> GetGemachManagersByGemachId(int gemachid)
        {
            Gemach gemach = gemaches.Find(g => g.GemachId == gemachid);
            IEnumerable <GemachManager> retVal = gemach.GemachManagers;

            return(retVal);
        }
コード例 #3
0
ファイル: GemachesController.cs プロジェクト: 4199918/Gemachs
        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);
        }
コード例 #4
0
ファイル: GemachesController.cs プロジェクト: 4199918/Gemachs
        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);
        }
コード例 #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));
        }
コード例 #6
0
ファイル: GemachesController.cs プロジェクト: 4199918/Gemachs
        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);
        }
コード例 #7
0
ファイル: GemachesController.cs プロジェクト: 4199918/Gemachs
        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);
        }
コード例 #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));
        }