public async Task <IActionResult> Edit(int id, [Bind("Id,ParDeMoneda,Equivalencia,MonedasId")] Tasas_de_Cambio tasas_de_Cambio) { if (id != tasas_de_Cambio.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tasas_de_Cambio); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Tasas_de_CambioExists(tasas_de_Cambio.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MonedasId"] = new SelectList(_context.Monedas, "Id", "Name", tasas_de_Cambio.MonedasId); return(View(tasas_de_Cambio)); }
public async Task <IActionResult> Create([Bind("Id,ParDeMoneda,Equivalencia,MonedasId")] Tasas_de_Cambio tasas_de_Cambio) { if (ModelState.IsValid) { _context.Add(tasas_de_Cambio); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MonedasId"] = new SelectList(_context.Monedas, "Id", "Name", tasas_de_Cambio.MonedasId); return(View(tasas_de_Cambio)); }