Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("IdTaxa,Pret,DescriereTaxa")] Taxa taxa)
        {
            if (id != taxa.IdTaxa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(taxa);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TaxaExists(taxa.IdTaxa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(taxa));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("IdTaxa,Pret,DescriereTaxa")] Taxa taxa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(taxa);
                await _context.SaveChangesAsync();

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