public ActionResult DeleteConfirmed(int id) { TipoPagamentoSet tipoPagamentoSet = tipoPagamentoRepository.ObterPorId(id); tipoPagamentoRepository.Apagar(tipoPagamentoSet); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Nome,Ativo")] TipoPagamentoSet tipoPagamentoSet) { if (ModelState.IsValid) { tipoPagamentoRepository.Atualizar(tipoPagamentoSet); return(RedirectToAction("Index")); } return(View(tipoPagamentoSet)); }
// GET: TipoPagamento/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TipoPagamentoSet tipoPagamentoSet = tipoPagamentoRepository.ObterPorId(id.Value); if (tipoPagamentoSet == null) { return(HttpNotFound()); } return(View(tipoPagamentoSet)); }
public void Inserir(TipoPagamentoSet entity) { try { if (entity != null) { dbcontext.TipoPagamentoSet.Add(entity); dbcontext.Entry(entity).State = System.Data.Entity.EntityState.Added; dbcontext.SaveChanges(); } } catch (Exception ex) { logger.Error(ex); } }