public void ExportToExcel() { //Calling the bridge pattern and assigning the excel export class. IExporter exporter = new ExcelExporter(); DataForIntervals dataForIntervals = new ExportData(Response); //Injecting Response object for processing dataForIntervals.Exporter = exporter; //Injecting the Excel class object dataForIntervals.Export(); //Calling the excel export method }
private void btnExport_ItemClick(object sender, ItemClickEventArgs e) { FolderBrowserDialog Dlg = new FolderBrowserDialog(); if (DialogResult.OK == Dlg.ShowDialog()) { string toFolder = Dlg.SelectedPath; XtraMessageBox.Show(ExportData.Export(toFolder)); } }
/// <summary> /// Saves a JSON file that contains a Bullion account. /// File dialog will open to this project's directory where the account file can be saved. /// </summary> /// <remarks> /// <para>If the user does not have an account Id, then an account Id will be assigned.</para> /// <para>If the user does have an account Id, then their account Id will not be changed.</para> /// </remarks> private void Export_Data_Click(object sender, RoutedEventArgs e) { if (account.Id == 0 && account.Savings > 0 || account.Cash > 0 || account.Crypto > 0) { Random random = new Random(); account.Id = random.Next(10000000, 99999999); } ExportData exdata = new ExportData(); exdata.Export(account, cipher); }
private void ExportJSON_Click(object sender, RoutedEventArgs e) { var dialog = new SaveFileDialog { Filter = "Arquivos JSON|*.json|Todos os arquivos|*.*" }; dialog.FileOk += (_, __) => { Cursor = Cursors.Wait; ExportData.Export(dialog.FileName); Cursor = Cursors.Arrow; }; dialog.ShowDialog(); }