Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("AmazonCurrencyID,Currency")] AmazonCurrency amazonCurrency)
        {
            if (id != amazonCurrency.AmazonCurrencyID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(amazonCurrency);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AmazonCurrencyExists(amazonCurrency.AmazonCurrencyID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(amazonCurrency));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("AmazonCurrencyID,Currency")] AmazonCurrency amazonCurrency)
        {
            if (ModelState.IsValid)
            {
                _context.Add(amazonCurrency);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(amazonCurrency));
        }