Beispiel #1
0
        private void createPdfFromArchivebutton_Click(object sender, EventArgs e)
        {
            int result;

            if (int.TryParse(archiveComboBox.Text, out result))
            {
                IPdfDocument pdfInvoice;
                var          invoice = invoiceRepository.FetchInvoice(result);
                if (invoice != null)
                {
                    if (invoice is USDInvoice)
                    {
                        pdfInvoice = new USDPdfDocument(invoice);
                    }
                    else if (radioButtonEUR.Checked)
                    {
                        pdfInvoice = new EURPdfDocument(invoice);
                    }
                    else
                    {
                        pdfInvoice = new SEKPdfDocument(invoice);
                    }
                }
                else
                {
                    MessageBox.Show("Fakturanumret hittades inte!");
                }
            }
            else
            {
                MessageBox.Show("Fakturanumret har ett felaktigt format!");
            }
        }
Beispiel #2
0
        private void createPdfButton_Click(object sender, EventArgs e) //Initialize Pdfmaker.
        {
            IPdfDocument pdfInvoice;

            if (radioButtonUSD.Checked)
            {
                pdfInvoice = new USDPdfDocument(CompileNewInvoice());
            }
            else if (radioButtonEUR.Checked)
            {
                pdfInvoice = new EURPdfDocument(CompileNewInvoice());
            }
            else
            {
                pdfInvoice = new SEKPdfDocument(CompileNewInvoice());
            }
            //SEKPdfDocument temp = new SEKPdfDocument(CompileNewInvoice(),selectedLogo);
        }