Exemple #1
0
        private void BIC_Cancel_Click(object sender, EventArgs e)
        {
            _page        = null;
            _invoicePage = null;
            _invoicePage = null;

            GetBackToHome();
        }
 private IActionResult ProcessInvoicePaymentSucceeded(StripeInvoice invoiceData)
 {
     try
     {
         var paymentInvoice = invoiceData.ToPaymentInvoice();
         //Get Customer
         if (paymentInvoice.Customer == null && paymentInvoice.CustomerId != null)
         {
             paymentInvoice.Customer = _customerService.GetCustomer(paymentInvoice.CustomerId);
         }
         //Inly proceed if email is found.
         var logoUrl     = $"{Request.Scheme}://{Request.Host}/images/shield.png";
         var invoicePage = new InvoicePageModel
         {
             Title     = "Subscription Invoice",
             Subtitle  = "Thank you for choosing Data Estate!",
             BrandName = "Data Estate Pty Ltd",
             LogoUrl   = logoUrl,
             Invoice   = paymentInvoice
         };
         invoicePage.Invoice.Paid = true;
         var invoiceSuccessEmail = _templateService.RenderTemplateAsync("Emails/InvoiceSucceeded", invoicePage).Result;
         var recipients          = new List <string>();
         var customerName        = paymentInvoice.Customer.Name == null ? "" : paymentInvoice.Customer.Name;
         recipients.Add(
             $"{customerName} <{paymentInvoice.Customer.Email}>"
             );
         //Build Mail Object
         var mailContent = new MailContent
         {
             Receivers = recipients,
             Subject   = $"Data Estate Subscription Invoice {paymentInvoice.InvoiceNumber}",
             Html      = invoiceSuccessEmail
         };
         return(Json(_mailService.Send(mailContent), _defaultSettings));
         //return Content(invoiceSuccessEmail.Result, "text/html");
     }
     catch (Exception e)
     {
         Response.StatusCode = 400;
         var errorResponse = new ErrorResponse
         {
             Status     = "Error",
             StatusCode = 400,
             Message    = e.Message
         };
         _logger.LogError($"{e.Message} - {e.StackTrace}");
         return(Json(errorResponse, _defaultSettings));
     }
 }
Exemple #3
0
        public InvoiceControl(Panel hPanel, Panel vPanel, PageModel page)
            : this()
        {
            _hPanel      = hPanel;
            _vPanel      = vPanel;
            _page        = page;
            _dealerList  = DealerManager.GetAllDealers();
            _productList = ProductManager.GetAllProducts();
            _invoicePage = JsonConvert.DeserializeObject <InvoicePageModel>(JsonConvert.SerializeObject(_page));

            TBIC_Discount.MaxLength = 2;

            BindObjectDataToInterface();
        }
Exemple #4
0
        public InvoiceControl(Panel hPanel, Panel vPanel, InvoicePageModel invoicePage)
            : this()
        {
            _hPanel      = hPanel;
            _vPanel      = vPanel;
            _invoicePage = invoicePage;
            _page        = JsonConvert.DeserializeObject <PageModel>(JsonConvert.SerializeObject(_invoicePage));
            _dealerList  = DealerManager.GetAllDealers();
            _productList = ProductManager.GetAllProducts();

            if (_invoicePage.sale != null)
            {
                _itemList = CommonHelper.CloneList <ItemModel>(_invoicePage.AllProducts);
            }

            TBIC_Discount.MaxLength = 2;

            BindObjectDataToInterface();
        }
 public InvoiceManager(InvoicePageModel invoiceData)
 {
     _invoiceData = invoiceData;
     //ExcelApp.LoadExcelFile(appDocumentPath + @"\Libs\Files\CoreFiles\TemplateFiles\invoice-template.xlsx", 1);
     ExcelApp.LoadExcelFile(Environment.CurrentDirectory + @"\Libs\Files\CoreFiles\TemplateFiles\invoice-template.xlsx", 1);
 }