示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,TypePackingId,Volume,PerfumeInformationId")] Packings packings)
        {
            if (id != packings.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(packings);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PackingsExists(packings.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PerfumeInformationId"] = new SelectList(_context.PerfumesInformations, "Id", "Id", packings.PerfumeInformationId);
            ViewData["TypePackingId"]        = new SelectList(_context.TypesPackings, "Id", "Id", packings.TypePackingId);
            return(View(packings));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,YearOfIssue,ClassificationPerfumeId,ManufacturerId,PicturePath,PerfumeName")] PerfumesInformations perfumesInformations)
        {
            if (id != perfumesInformations.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(perfumesInformations);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PerfumesInformationsExists(perfumesInformations.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClassificationPerfumeId"] = new SelectList(_context.ClassificationsPerfumes, "Id", "ClassificationPerfume", perfumesInformations.ClassificationPerfumeId);
            ViewData["ManufacturerId"]          = new SelectList(_context.Manufacturers, "Id", "Manufacturer", perfumesInformations.ManufacturerId);
            return(View(perfumesInformations));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Manufacturer")] Manufacturers manufacturers)
        {
            if (id != manufacturers.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(manufacturers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ManufacturersExists(manufacturers.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(manufacturers));
        }
示例#4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Price,DateCreation,CurrencyId")] Prices prices)
        {
            prices.DateCreation = DateTime.Now;
            if (id != prices.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(prices);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PricesExists(prices.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CurrencyId"] = new SelectList(_context.Currencys, "Id", "Id", prices.CurrencyId);
            return(View(prices));
        }
示例#5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,TypePacking")] TypesPackings typesPackings)
        {
            if (id != typesPackings.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(typesPackings);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TypesPackingsExists(typesPackings.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(typesPackings));
        }
示例#6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,PackingId,PriceId")] Perfumes perfumes)
        {
            if (id != perfumes.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(perfumes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PerfumesExists(perfumes.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PackingId"] = new SelectList(_context.Packings, "Id", "Id", perfumes.PackingId);
            ViewData["PriceId"]   = new SelectList(_context.Prices, "Id", "Id", perfumes.PriceId);
            return(View(perfumes));
        }
示例#7
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ClassificationPerfume")] ClassificationsPerfumes classificationsPerfumes)
        {
            if (id != classificationsPerfumes.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(classificationsPerfumes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClassificationsPerfumesExists(classificationsPerfumes.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(classificationsPerfumes));
        }