public void SaveGCComBookmarkGeocaches(GCComBookmarks.Bookmark bm, List<string> gcCodes) { lock (this) { if (_dbcon != null) { List<string> gcav = LoadGCComBookmarkGeocaches(bm); foreach (string gc in gcav) { if (!gcCodes.Contains(gc)) { _dbcon.ExecuteNonQuery(string.Format("delete from gccomgc where bm_id='{0}' and gccode='{1}'", bm.ID, gc)); } } foreach (string gc in gcCodes) { if (!gcav.Contains(gc)) { _dbcon.ExecuteNonQuery(string.Format("insert into gccomgc (bm_id, gccode) values ('{0}', '{1}')", bm.ID, gc)); } } } } }
public void DeleteGCComBookmark(GCComBookmarks.Bookmark bm) { lock (this) { if (_dbcon != null) { _dbcon.ExecuteNonQuery(string.Format("delete from gccomgc where bm_id='{0}'", bm.ID)); _dbcon.ExecuteNonQuery(string.Format("delete from gccombm where bm_id='{0}'", bm.ID)); } } }
public List<string> LoadGCComBookmarkGeocaches(GCComBookmarks.Bookmark bm) { List<string> result = new List<string>(); lock (this) { DbDataReader dr = _dbcon.ExecuteReader(string.Format("select gccode from gccomgc where bm_id='{0}'", bm.ID)); while (dr.Read()) { result.Add(dr[0] as string); } } return result; }
public void AddGCComBookmark(GCComBookmarks.Bookmark bm) { lock (this) { if (_dbcon != null) { _dbcon.ExecuteNonQuery(string.Format("insert into gccombm (bm_id, bm_name, bmguid) values ('{0}','{1}','{2}')", bm.ID, bm.Name.Replace("'", "''"), bm.Guid)); } } }
public void SaveGCComBookmarkGeocaches(GCComBookmarks.Bookmark bm, List<string> gcCodes) { _settingsStorage.SaveGCComBookmarkGeocaches(bm, gcCodes); }
public List<string> LoadGCComBookmarkGeocaches(GCComBookmarks.Bookmark bm) { return _settingsStorage.LoadGCComBookmarkGeocaches(bm); }
public void DeleteGCComBookmark(GCComBookmarks.Bookmark bm) { _settingsStorage.DeleteGCComBookmark(bm); }
public void AddGCComBookmark(GCComBookmarks.Bookmark bm) { _settingsStorage.AddGCComBookmark(bm); }