public void SetUp() { FileLoader fileLoader = new FileLoader(); pollingVenues = fileLoader.GetPollingVenues(@"IO\TestInput.xml", ((o, e) => { })); path = Directory.CreateDirectory("Test").FullName; fileSaver = new FileSaver(path, "TestVenue"); }
/// <summary> /// Exports the data for each polling venue dependent on which checkboxes in /// the export form that are checked. /// </summary> private void ExportData() { //If no boxes are checked if(!this.ExportElementsSelected()) { MessageBox.Show("No export elements are selected", "Notification", MessageBoxButtons.OK); return; } if (export.FolderBrowserDialog.ShowDialog() == DialogResult.OK) { FileSaver fs = new FileSaver(this.SelectedExportFolderPath(), this.GetSelectedPollingVenue().PollingVenueAddress.Name); if (export.PollingCards.Checked) { fs.SavePollingCards(this.GetSelectedPollingVenue(), this.ElectionName(), this.ElectionDate()); } if (export.VoterLists.Checked) { fs.SaveVoterList(this.GetSelectedPollingVenue().Persons, this.ElectionName(), this.ElectionDate()); } if (export.Voters.Checked) { fs.SaveVoters(this.GetSelectedPollingVenue()); } } export.Close(); //close the form }