public async Task <IActionResult> Edit(int id, [Bind("Id,Descricao")] Formapagamentos formapagamentos) { if (id != formapagamentos.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(formapagamentos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FormapagamentosExists(formapagamentos.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(formapagamentos)); }
public async Task <IActionResult> Create([Bind("Id,Descricao")] Formapagamentos formapagamentos) { if (ModelState.IsValid) { _context.Add(formapagamentos); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(formapagamentos)); }
public IActionResult Create(Formapagamentos cust) { if(ModelState.IsValid) { FormapagamentosRepository.Add(cust); return RedirectToAction("Index"); } return View(cust); }
public IActionResult Edit(Formapagamentos obj) { if(ModelState.IsValid) { FormapagamentosRepository.Update(obj); return RedirectToAction("Index"); } return View(obj); }
// GET: /Formapagamentos/Edit/1 public IActionResult Edit(int?id) { if(id == null) { return NotFound(); } Formapagamentos obj = FormapagamentosRepository.FindByID(id.Value); if(obj == null) { return NotFound(); } return View(obj); }