Exemplo n.º 1
0
        private void EmailReceipt()
        {
            try
            {
                if (buyer.Count == 1)
                {
                    if (!String.IsNullOrEmpty(buyer[0].Person.email))
                    {
                        ((App)App.Current).GetWorkOrderPayment(workOrderId).ContinueWith(a => WorkOrderPaymentLoaded(a.Result));
                    }
                    else //let EO know the customer needs to add an email address
                    {
                        EmailHelpers emailHelper = new EmailHelpers();

                        EOMailMessage mailMessage = new EOMailMessage();

                        string emailHtml = emailHelper.ComposeMissingEmail(buyer[0]);

                        mailMessage = new EOMailMessage("*****@*****.**", "*****@*****.**", "Missing Customer Email", emailHtml, "Orchids@5185");

                        Email.SendEmail(mailMessage);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
0
        private async void EmailReceipt(WorkOrderPaymentDTO workOrderPayment)
        {
            try
            {
                if (Customer.Person.person_id > 0)
                {
                    EmailHelpers emailHelper = new EmailHelpers();

                    EOMailMessage mailMessage = new EOMailMessage();

                    string emailHtml = String.Empty;

                    if (!String.IsNullOrEmpty(Customer.Person.email))
                    {
                        GenericGetRequest         request         = new GenericGetRequest("GetWorkOrderPrices", "workOrderId", workOrderPayment.WorkOrderId);
                        GetWorkOrderPriceResponse workOrderPrices = await((App)App.Current).GetRequest <GetWorkOrderPriceResponse>(request);

                        emailHtml = emailHelper.ComposeReceipt(currentWorkOrder, workOrderPayment, workOrderPrices);

                        mailMessage = new EOMailMessage("*****@*****.**", Customer.Person.email, "Elegant Orchids Receipt", emailHtml, "Orchids@5185");
                    }
                    else //let EO know the customer needs to add an email address
                    {
                        emailHtml = emailHelper.ComposeMissingEmail(Customer);

                        mailMessage = new EOMailMessage("*****@*****.**", "*****@*****.**", "Missing Customer Email", emailHtml, "Orchids@5185");
                    }

                    Email.SendEmail(mailMessage);
                }
            }
            catch (Exception ex)
            {
            }
        }