private void BT_export_Click(object sender, EventArgs e) { string db_path = connection_string; //string photo_path = TB_photo_export.Text; string dest = TB_dest.Text; if (File.Exists(db_path)) { // Get all files from db List <string> files = data_get.get_all_photo(); // ZIP all data or save in directory CopyFiles cpf = new CopyFiles(files.ToList(), db_path, dest); cpf.ShowDialog(); this.Hide(); } else { MessageBox.Show("Export or photo paths error"); } }
private void BT_import_Click(object sender, EventArgs e) { string source = TB_source.Text; if (File.Exists(source)) { // TODO Background Worker copy // Copy db_path => connection_string // Copy files => identify_dir_path //Import or not if (MessageBox.Show($"Do you want to import the new data ? {Environment.NewLine}Warning: All the current data will be overwritten, so think to backup them before to import.", "Import", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { CopyFiles cpf = new CopyFiles(source); cpf.ShowDialog(); this.Hide(); } } else { MessageBox.Show("Import paths error"); } }