Example #1
0
        // Export Data to CSV, JSON and XML
        private void btnExport_Click(object sender, EventArgs e)
        {
            using (FolderBrowserDialog folderBrowser = new FolderBrowserDialog())
            {
                if (folderBrowser.ShowDialog() == DialogResult.OK)
                {
                    saveLocation = folderBrowser.SelectedPath;
                    ExportData.ExportXML(users, saveLocation + @"\users");
                    ExportData.ExportJSON(users, saveLocation + @"\users");
                    ExportData.ExportCSV(users, saveLocation + @"\users");

                    btnExport.Enabled  = false;
                    btnDisplay.Enabled = false;
                    MessageBox.Show("Files have been exported!", "Success", MessageBoxButtons.OK);
                    lblSuccess.Visible = true;
                    btnRestart.Visible = true;
                }
            }
        }