Esempio n. 1
0
        public async System.Threading.Tasks.Task <IActionResult> OrderConfirmationAsync(Guid Id)
        {
            ViewBag.PurchaseId = Id.ToString();
            string email = User.Identity.Name;

            if (Id != Guid.Empty)
            {
                List <Purchase> purchases = purchaseRepository.GetPurchaseByUserId(Guid.Parse(userManager.GetUserId(HttpContext.User)));
                foreach (Purchase purchase in purchases)
                {
                    purchaseRepository.DeletePurchase(purchase);
                }
                await messageSender.SendMessage(email, "Order confirmation message",
                                                messageSender.BuildConfirmationMessage(email, dateService.GetDate()));
            }

            return(View());
        }
Esempio n. 2
0
 public bool DeletePurchase(Purchase purchase)
 {
     return(_purchaseRepository.DeletePurchase(purchase));
 }