private void button1_Click(object sender, EventArgs e) { List <string> warningMessages = throughOutCheck(); if (warningMessages.Count > 0) { if (!doesUserWantToProceed(warningMessages)) { return; // if user decide to take another look, then return } } List <Account> accountList = new List <Account>(); for (int i = 0; i < MAX_ACCOUNTS_SUPPORTED; i++) { if (accountCheckBoxes[i].Checked) { string accountType = accountTypeComboBoxes[i].Text; string ccyCode = accountCcyComboBoxes[i].Text; string longNumber = "100001401" + accountLongNumberTextBoxes[i].Text; string shortNumber = ""; if (accountShortNumberTextBoxes[i].Text != "") { shortNumber = "9000" + accountShortNumberTextBoxes[i].Text; } accountList.Add(new Account(accountType, ccyCode, longNumber, shortNumber)); } } CustomerInformation customer; if (addressInclusionCheckBox.Checked) { customer = new CustomerInformation(customerNameTextBox.Text, addressLineTextBox1.Text, addressLineTextBox2.Text, addressLineTextBox3.Text); } else { customer = new CustomerInformation(customerNameTextBox.Text); } BranchInfo branch = new BranchInfo((Branch)(Properties.Settings.Default.DefaultBranchIndex)); bool inclEmail = emailInclusionCheckBox.Checked; string fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + customer.GetName() + ".pdf"; Pdf_Generation_Class.GenerateWelcomeLetterSimple(fileName, customer, accountList, branch, inclEmail); if (openFileCheckBox.Checked) { System.Diagnostics.Process.Start(fileName); } }
private void button1_Click(object sender, EventArgs e) { Pdf_Generation_Class.GenerateWelcomeLetter(false, "test.pdf"); }