public void Save(jarmu jarmu) { view.errorRendszam = null; view.errorFerohely = null; bool helyes = true; if (string.IsNullOrWhiteSpace(jarmu.rendszam)) { view.errorRendszam = Resources.KotelezoMezo; helyes = false; } if (jarmu.ferohely < 1) { view.errorFerohely = Resources.KotelezoMezo; helyes = false; } // Repo ellenőrzés if (helyes) { if (repo.Exists(jarmu)) { try { repo.Update(jarmu); } catch (Exception ex) { view.errorRendszam = ex.Message; } } else { try { repo.Insert(jarmu); } catch (Exception ex) { view.errorRendszam = ex.Message; } } } }
public void Add(jarmu jarmu) { view.bindingList.Insert(0, jarmu); repo.Insert(jarmu); view.totalItems++; }
public void Add(jarmu jarmu) { view.bindingList.Add(jarmu); // hozzáadás ehhez a contexthez is repo.Insert(jarmu); }