Ana içeriğe atla

Kayıtlar

Some JS Code Example

var checkboxes = document.querySelectorAll('input[type="checkbox"]'); for (var i = 0; i < checkboxes.length; i++) {     var id = checkboxes[i].id     document.getElementById(id).parentNode.getElementsByTagName('input')[0].addEventListener('change', (event) => {         if (event.currentTarget.checked) {             event.currentTarget.parentNode.getElementsByTagName('input')[1].value = null;         }         else {             event.currentTarget.parentNode.getElementsByTagName('input')[1].value = false;         }     }); }

SmartStore SQLite Backup and Restore

protected override async Task RestoreDatabaseCore(string backupFullPath, bool async, CancellationToken cancelToken = default) { using var backupConnection = Database.GetDbConnection() as SqliteConnection; var thisConnection = new SqliteConnection("Data Source=" + backupFullPath); try { SqliteConnection.ClearAllPools(); if (async) { await thisConnection.OpenAsync(cancelToken); } else { thisConnection.Open(); } thisConnection.BackupDatabase(backupConnection); } finally { if (async) { await backupConnection.CloseAsync(); await thisConnection.CloseAsync(); } else { backupConn...

NopCommerce SQLite Backup and Restore

        /// <summary>         /// Creates a backup of the database          /// </summary>         public virtual Task BackupDatabaseAsync(string fileName)         {             try             {                 var backup = new SqliteConnection($"Data Source={fileName}");                 var dbConnection = new SqliteConnection(DataSettingsManager.LoadSettings().ConnectionString);                 dbConnection.Open();                 dbConnection.BackupDatabase(backup);                 //SqliteConnection.ClearPool(dbConnection);                 dbConnection.Close();   ...

File Backup

            var srcfile = Path.Combine(filePath, srcFilename);             var destfile = Path.Combine(filePath, destFileName);             if (File.Exists(destfile))                 File.Delete(destfile);             if (IsCopy)                 BackupDB(filePath, srcFilename, destFileName);             else                 File.Move(srcfile, destfile);

StringHelper Contains for Sqlite

  namespace SimplCommerce.Infrastructure.Helpers {     public static class StringHelper     {         public static bool Contains(this String str,                                         String substr,                                         StringComparison cmp)         {             if (substr == null)                 throw new ArgumentNullException("substring substring",                                                 " cannot be null.");             else if (!Enum.IsDefined(typeof(StringComparison), cmp)) ...