Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,ClassificationPerfume")] ClassificationsPerfumes classificationsPerfumes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(classificationsPerfumes);
                await _context.SaveChangesAsync();

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