public COMPTA_Bank CreateBank(COMPTA_Bank bankToAdd) { using (SUPERPEntities context = new SUPERPEntities(false)) { var bank = context.COMPTA_Bank.Add(bankToAdd); context.SaveChanges(); return(bank); } }
public COMPTA_Bank EditBank(COMPTA_Bank bankToEdit) { using (SUPERPEntities context = new SUPERPEntities(false)) { var bank = context.COMPTA_Bank.Find(bankToEdit.id); if (bank == null) { return(null); } bank = bankToEdit; context.SaveChanges(); return(bank); } }