Exemplo n.º 1
0
        public static void SendEmailWithAttachement(ClientEntity clientEntity, EmailEntity emailEntity, IInvoiceDetails invoiceDetails, string pdfFileName, DateTime now)
        {
            var subject = "Invoice #" + InvoiceNameGenerator.GetName(invoiceDetails.Number, now);
            var sender = new Sender(new DefaultSmtpWrapper().Data);

            var body = EmailBodyCreator.Create(emailEntity, clientEntity.PointOfContactName);

            sender.Send(clientEntity.PointOfContactEmail, subject, body, new List<string> { pdfFileName });
        }
Exemplo n.º 2
0
        public static void EmailIfRequested(Repository repository, string pdfFilename, IInvoiceDetails invoiceDetails, DateTime now)
        {
            var send = UIRetriever.GetBool("Do you want to email this invoice to a client?");

            if (send)
            {
                var emailTarget = ClientSelector.Get(repository.ClientsWrapper.Data);
                SendEmailWithAttachement(emailTarget, repository.EmailWrapper.Data, invoiceDetails, pdfFilename, now);
                EmailSentNotifier.ShowSentToClient(emailTarget);
            }

            Console.WriteLine("");
        }
Exemplo n.º 3
0
 public InvoiceController(IInvoiceDetails invoiceDetailsBL)
 {
     _invoiceDetailsBL = invoiceDetailsBL;
 }
Exemplo n.º 4
0
 public InvoiceDetailsDto(IInvoiceDetails invoice)
 {
     InvoiceType = invoice.InvoiceType.ToString();
 }