public void Export() { try { if (string.IsNullOrEmpty(ExportPath)) { throw new Exception("Path cannot be empty."); } EXP.Export(ExportPath); MessageBoxFactory.ShowInfo("Database exported to: " + ExportPath, "Exported"); } catch (Exception e) { MessageBoxFactory.ShowError(e); } }
public void Import() { try { if (string.IsNullOrEmpty(importPath) || !File.Exists(ImportPath)) { throw new Exception("File not found."); } EXP.Import(importPath); MessageBoxFactory.ShowInfo("Database has been imported.", "Imported"); DatabaseUpdated = true; } catch (Exception e) { MessageBoxFactory.ShowError(e); } }