public void noveMiestoPrihlasenia(Miesto miesto) { Debug.WriteLine("Metoda noveMiestoPrihlasenia bola vykonana"); using (SQLiteConnection databaza = new SQLiteConnection(new SQLitePlatformWinRT(), App.databaza)) { databaza.RunInTransaction(() => { databaza.Insert(miesto); }); } }
public void aktualizujMiestoPrihlasenia(Miesto miesto, int idMiesto) { Debug.WriteLine("Metoda aktualizujMiestoPrihlasenia bola vykonana"); using (SQLiteConnection databaza = new SQLiteConnection(new SQLitePlatformWinRT(), App.databaza)) { var existujuceMesto = databaza.Query <Miesto>("SELECT * FROM Miesto WHERE idMiesto =" + idMiesto).FirstOrDefault(); if (existujuceMesto != null) { existujuceMesto.stat = miesto.stat; existujuceMesto.okres = miesto.okres; existujuceMesto.pozicia = miesto.pozicia; databaza.RunInTransaction(() => { databaza.Update(existujuceMesto); }); } } }