public void Excluir(CategoriaPagamento item) { using (quiteriamodasEntities db = new quiteriamodasEntities()) { db.Entry(item).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
public bool Salvar(CategoriaPagamento item) { try { using (quiteriamodasEntities db = new quiteriamodasEntities()) { db.CategoriaPagamento.Add(item); db.SaveChanges(); return(true); } } catch (Exception) { //MessageBox.Show(e.Message); return(false); } }