Exemplo n.º 1
0
        /// <summary>
        /// Store an updated SettingsModel in the database.
        /// </summary>
        public void SaveSettings(SettingsModel settings)
        {
            InitDatabase();

            conn.InsertOrReplace(settings);
            DatabaseChangeListeners?.Invoke();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Save a new PastSession or update an existing PastSession in the
        /// database.
        /// </summary>
        public int SaveSession(PastSession session)
        {
            InitDatabase();

            int retval;

            if (session.ID != 0)
            {
                retval = conn.Update(session);
            }
            else
            {
                retval = conn.Insert(session);
            }
            DatabaseChangeListeners?.Invoke();
            return(retval);
        }