public void Execute(MainMenuAction action) { switch (action) { case MainMenuAction.SaveDatabase: new DbSerializer().EncryptAndSerialize(_db, _mySettings.GetCombinedSetting("DbFileFullPath")); break; case MainMenuAction.LoadDatabase: _db = new DbSerializer().DecryptAndDeserialize(_mySettings.GetCombinedSetting("DbFileFullPath")); break; case MainMenuAction.ClearDatabase: _dbCleaner.ClearAllTables(_db); break; case MainMenuAction.MakeDatabaseBackup: _dbBackuper.MakeDbTxtCopy(); break; case MainMenuAction.ExportDatabaseToTxt: _dbToTxtSaver.SaveDbInTxt(); break; case MainMenuAction.ImportDatabaseFromTxt: ImportDatabaseFromTxt(); break; case MainMenuAction.RemoveExtraBackups: new DbBackupOrganizer().RemoveIdenticalBackups(); break; case MainMenuAction.RemoveAllNonFirstInMonth: new DbBackupOrganizer().RemoveAllNonFirstInMonth(); break; } }
public void MakeDbTxtCopy() { _txtSaver.SaveDbInTxt(); ZipTxtDb(); DeleteTxtDb(); }