@page "/quotesdetails/{id:int}"
reply Quote Details

Quote ID : QO-@model.QuotId

80 Orville Dr

Bohemia, NY 11716

516-699-2092/631-334-2594

Info@seahavenindustries.com

Date: @if (model.Date != null) { @model.Date.Value.ToString("MMM dd yyyy") }

Proposal For :

@if (model.WorkOrder != null) {

@model.WorkOrder.WorkerOrderTitle

}

POC :

@if (model.Contacts != null) {

@(model.Contacts.FirstName + " " + model.Contacts.LastName)

}

PO # :

@model.PO

TT # :

@model.TT

Project Name :

@model.ProjectName

Site Name:

@model.SiteName

Site ID:

@model.SiteId


Address

Billing Address :

@model.BillingAddress

Shipping Address :

@model.ShippingAddress


Line Items
@*

Line Item 1 :

Completed site assessment for concrete crack repairs as needed that are causing trip hazards.


*@
@if (model.LineItems != null) { foreach (var itm in model.LineItems) {

@itm.Descriptions:

$@itm.Lineitem

}

Total:

$@model.LineItems.Sum(s => s.Lineitem)

}
@if (isloading) {
Loading…
} @using SeaHavenIndustries.Data.IRepository @using SeaHavenIndustries.Data.Services @using global::Data.SeaHavenIndustries @inject IQuotesRepository _service; @inject PdfService pdfService @inject IJSRuntime JSRuntime @inject ChangeStepService StepService @code { [Parameter] public int? id { get; set; } public bool isloading = true; private int random5DigitNumber = 0; private bool ispdf = false; private Quotes model = new(); protected override async Task OnInitializedAsync() { ispdf = true; if (id != null && id != 0) { model = await _service.GetQuotesById(id.Value); } isloading = false; ispdf = false; } // protected override async Task OnAfterRenderAsync(bool firstRender) // { // if (firstRender) // { // await JSRuntime.InvokeVoidAsync("SavelocalStorage"); // } // } private async Task GeneratePdf() { ispdf = true; var htmlContent = await JSRuntime.InvokeAsync("getHtmlContent", StepService.htmlContentReference); var pdfBytes = await pdfService.GeneratePdf(htmlContent); ispdf = false; var pdfBase64 = Convert.ToBase64String(pdfBytes); await JSRuntime.InvokeVoidAsync("downloadFile", pdfBase64, "Quote.pdf"); } private async Task SendPdf() { ispdf = true; var htmlContent = await JSRuntime.InvokeAsync("getHtmlContent", StepService.htmlContentReference); var pdfBytes = await pdfService.GeneratePdf(htmlContent); var result = await _service.SendEmailQuote(pdfBytes, model.Id); if (result == "success") { await ShowSweetAlert("Email send successfully", "success"); } else { await ShowSweetAlert(result, "error"); } ispdf = false; } private async Task ShowSweetAlert(string title, string icon) { // Display a SweetAlert dialog await JSRuntime.InvokeVoidAsync("Swal.fire", new { toast = true, showConfirmButton = false, timer = 3000, title = title, icon = icon, position = "top-end" }); await JSRuntime.InvokeVoidAsync("closemodal"); } }