public static void UpdateValue(Targets_CoinsDB _UpdateValue) { var context = new DataBaseConnectionContext(); context.Update(_UpdateValue); context.SaveChanges(); }
public static void AddValue(Targets_CoinsDB _AddValue) { var context = new DataBaseConnectionContext(); context.Add(_AddValue); context.SaveChanges(); }
public SaveCoins(int _Year, double _ECCC, double _Euro, double _Dolars, double _Sek) { IEnumerable <Targets_CoinsDB> List = TargetsCoinsController.Load_Year(_Year); if (List.Count() == 0) { var NewRow = new Targets_CoinsDB { Year = _Year, ECCC = _ECCC, Euro = _Euro, USD = _Dolars, SEK = _Sek, }; TargetsCoinsController.AddValue(NewRow); } else { List.First().ECCC = _ECCC; List.First().Euro = _Euro; List.First().USD = _Dolars; List.First().SEK = _Sek; TargetsCoinsController.UpdateValue(List.First()); } }