public COMPTA_Currency CreateCurrency(COMPTA_Currency currencyToAdd) { using (SUPERPEntities context = new SUPERPEntities(false)) { var currency = context.COMPTA_Currency.Add(currencyToAdd); context.SaveChanges(); return(currency); } }
public COMPTA_Currency EditCurrency(COMPTA_Currency currencyToEdit) { using (SUPERPEntities context = new SUPERPEntities(false)) { var currency = context.COMPTA_Currency.Find(currencyToEdit.id); if (currency == null) { return(null); } currency = currencyToEdit; context.SaveChanges(); return(currency); } }