Пример #1
0
        public void updateMapResource(MapDownloadResource mapResource)
        {
            ContentValues values = new ContentValues();

            values.Put(STATE, mapResource.DownloadState);
            values.Put(NO_DOWNLOADED_BYTES, mapResource.NoDownloadedBytes);
            values.Put(SKM_FILE_PATH, mapResource.getSKMFilePath());
            values.Put(SKM_FILE_SIZE, mapResource.getSkmFileSize());
            values.Put(TXG_FILE_PATH, mapResource.getTXGFilePath());
            values.Put(TXG_FILE_SIZE, mapResource.getTXGFileSize());
            values.Put(ZIP_FILE_PATH, mapResource.getZipFilePath());
            values.Put(SKM_AND_ZIP_FILES_SIZE, mapResource.getSkmAndZipFilesSize());
            values.Put(UNZIPPED_FILE_SIZE, mapResource.getUnzippedFileSize());
            values.Put(DOWNLOAD_PATH, mapResource.DownloadPath);
            try
            {
                resourcesDAO.getDatabase().BeginTransaction();
                resourcesDAO.getDatabase().Update(MAPS_TABLE, values, CODE + "=?", new String[] { mapResource.Code });
                resourcesDAO.getDatabase().SetTransactionSuccessful();
            }
            catch (SQLException e)
            {
                SKLogging.WriteLog(TAG, "SQL EXCEPTION SAVE MAP DATA " + e.Message, SKLogging.LogError);
            }
            finally
            {
                resourcesDAO.getDatabase().EndTransaction();
            }
        }