Example #1
0
        //Methods
        #region Print
        public static void Print(IEnumerable <Invoice> selectedMailings, ESolutions.Web.UI.Page page)
        {
            PdfDocument result = new PdfDocument();

            foreach (var runner in selectedMailings)
            {
                InvoiceTableActions.Print(result, page, runner, Invoices.Print.DocumentTypes.Invoice);
            }

            page.Response.SendPdfFile("Invoices", result);
        }
Example #2
0
        /// <summary>
        /// Creates and prints a voucher for an invoice.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void CreateVoucherLink_Click(Object sender, EventArgs e)
        {
            try
            {
                Invoice     invoice = Invoice.LoadSingle((sender as IButtonControl).CommandArgument.ToInt32());
                PdfDocument result  = new PdfDocument();

                InvoiceTableActions.Print(result, this, invoice, Print.DocumentTypes.Voucher);

                this.Response.SendPdfFile("Gutschrift", result);
            }
            catch (Exception ex)
            {
                this.Master.ShowError(ex);
            }
        }
Example #3
0
        /// <summary>
        /// Sends the invoice via email.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void SendEmailButton_Click(Object sender, EventArgs e)
        {
            try
            {
                Int32       id      = (sender as IButtonControl).CommandArgument.ToInt32();
                Invoice     invoice = Invoice.LoadSingle(id);
                PdfDocument result  = new PdfDocument();

                InvoiceTableActions.Print(result, this, invoice, Print.DocumentTypes.Invoice);

                invoice.SendAsEmail(result);
            }
            catch (Exception ex)
            {
                this.Master.ShowError(ex);
            }
        }