示例#1
0
        private void exportCSVAll_Click(object sender, EventArgs e)
        {
            IExportFactory factory  = new ExportFactory();
            IExportFile    exporter = factory.getFileExporter("CSV");

            using (var folderDialog = new FolderBrowserDialog())
            {
                if (folderDialog.ShowDialog() == DialogResult.OK)
                {
                    StatusLabel.Text = exporter.export(new TicketServices().getTickets(), folderDialog.SelectedPath + "\\");
                }
            }
        }
示例#2
0
        private void exportCSVSelected_Click(object sender, EventArgs e)
        {
            if (showIDText.Text == "")
            {
                StatusLabel.Text = "No show selected";
                return;
            }
            IExportFactory factory  = new ExportFactory();
            IExportFile    exporter = factory.getFileExporter("CSV");

            using (var folderDialog = new FolderBrowserDialog())
            {
                if (folderDialog.ShowDialog() == DialogResult.OK)
                {
                    StatusLabel.Text = exporter.export(new TicketServices().getTicketsByShowID(Convert.ToInt32(showIDText.Text)), folderDialog.SelectedPath + "\\");
                }
            }
        }