Ejemplo n.º 1
0
        /// <summary>Creates the billing entry.</summary>
        /// <param name="parentId">The parent identifier.</param>
        /// <param name="total">The total.</param>
        private static void CreateBillingEntry(int parentId, int total, DateTime fromDate)
        {
            using (var db = new MusicManEntities())
            {
                var bill = new BillingDetail
                {
                    PersonID   = parentId,
                    BilledDate = DateTime.Today,
                    Amount     = total,
                    IsInvoiced = false,
                    IsPaid     = false,
                    BillMonth  = fromDate
                };

                db.BillingDetails.Add(bill);
                db.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        private static string BuildBody(BillingDetail invoice)
        {
            var month = invoice.BillMonth.Value.ToString("MMMM");
            var user  = User.GetDefaultUser();

            var body = new StringBuilder();

            body.Append("Your invoice for ");
            body.Append(user.CompanyName);
            body.Append(" for the month of ");
            body.Append(month);
            body.Append(" is due. Your total is $");
            body.Append(invoice.Amount);
            body.Append(". You can send a PayPal to ");
            body.Append(user.PayPalEmail);
            body.Append(" or Venmo to ");
            body.Append(user.VenmoUser);
            return(body.ToString());
        }
Ejemplo n.º 3
0
        private static void SendInvoice(BillingDetail invoice, string phone)
        {
            var body = BuildBody(invoice);

            MessageService.SendMessage(body, "+1" + phone);
        }