@errMsg+@* @if (appState != null) + { +
+ SessionId: @appState.SessionId + DateCreated: @appState.DateCreated + DateExpires: @appState.DateExpires + IPAddress: @appState.myIpAddress ++ } *@ + + + +@code { + [CascadingParameter] + public CascadingAppState appState { get; set; } + + #region "IPADDR" + [CascadingParameter] HttpContext? HttpContext { get; set; } + [Inject] public PersistentComponentState ApplicationState { get; set; } = default!; + + private PersistingComponentStateSubscription? _persistingSubscription; + //private bool _subsequentRender; + private string RemoteIpAddress = "Not Set"; + + protected override void OnInitialized() + { + this.RemoteIpAddress = this.HttpContext?.Connection.RemoteIpAddress?.ToString() ?? "Not Set"; + _persistingSubscription = ApplicationState.RegisterOnPersisting(this.PersistData); + } + + public Task PersistData() + { + this.ApplicationState.PersistAsJson
Current count: @currentCount
+ + + +@code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/Components/Pages/Error.razor b/Components/Pages/Error.razor new file mode 100644 index 0000000..7d98bd9 --- /dev/null +++ b/Components/Pages/Error.razor @@ -0,0 +1,36 @@ +@page "/Error" +@using System.Diagnostics + +
+ Request ID: @RequestId
+
+ Swapping to Development environment will display more detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
+ +@code { + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/Components/Pages/Home.razor b/Components/Pages/Home.razor new file mode 100644 index 0000000..9ac9bf2 --- /dev/null +++ b/Components/Pages/Home.razor @@ -0,0 +1,546 @@ +@rendermode InteractiveServer +@inject PersistentComponentState ApplicationState +@inject ClassObj.IPAddressService IpAddressService +@page "/" + +Unfortunately, the enrollment period for our Summer Growth Campaign has drawn to a close.
+Stay tuned for more great campaigns in the future!
++
+ It's time for our Summer Growth Program!
If you're looking to kick off your summer season with a wildly successful campgaign, then you've come to the right place!
+ Using this wizard, choose your target audience, decide what media you'd like to mail, choose from a few suggested designs (or request a custom design from our + creative team), and that's it! +
+Let us handle the rest!
+
+
+
+
+
+ }
+ else
+ {
+
+
+
+ }
+ }
+ else if (designTwo)
+ {
+ @if (isPostcard)
+ {
+
+
+ }
+ else
+ {
+
+
+ }
+ }
+ else if (designThree)
+ {
+ @if (isPostcard)
+ {
+
+
+ }
+ else
+ {
+
+
+ }
+ }
+ else if (designCustom)
+ {
+ + When you're asked for "additional comments," just give us an idea of what you have in mind and our customer care team will have some ideas + ready when we call you! +
+
+ }
+ else
+ {
+
+ }
+ Thank you for making our success possible.
+We appreciate loyal customers like you and look forward to continuing to be your complete auto repair, service and tire center!
+ } + else if (verseTwo) + { +We appreciate the trust you have shown in us and look forward to working with you in the future!
+ } + else if (verseThree) + { +We want you to know that we truly appreciate your business and will make every effort possible to continue to provide you with excellent car care.
+ } +From your friends at TopSpeed Tire
(your location name)
(888) 555-3712
(your location phone number)
+
+
+ 

















I'll specify method of payment when reviewing the order.
+ } + else if (check) + { +I'll be sending in a check by the invoice's due date (6/13/2025).
+ } ++ SessionId: @appState.SessionId + DateCreated: @appState.DateCreated + DateExpires: @appState.DateExpires + IPAddress: @appState.myIpAddress + IPAddress2: @(IpAddressService.RemoteIpAddress.ToString()) ++} + *@ \ No newline at end of file diff --git a/Components/Pages/Home.razor.cs b/Components/Pages/Home.razor.cs new file mode 100644 index 0000000..e4bf074 --- /dev/null +++ b/Components/Pages/Home.razor.cs @@ -0,0 +1,403 @@ +using Microsoft.AspNetCore.Components; +using System.ComponentModel.DataAnnotations; +using Telerik.Blazor; +using Telerik.Blazor.Components; +using Telerik.SvgIcons; +using kmCommonLibsCore; +using System.Net.Http; +using System.Text.Json; +using Microsoft.Extensions.Options; +using SummerBestWebForm2.AppState; +using SummerBestWebForm2.ClassObj; + +namespace SummerBestWebForm2.Components.Pages; + +public partial class Home +{ + [CascadingParameter] + public CascadingAppState appState { get; set; } = default!; + + async Task OnFinishHandler() + //private void SaveIt() + { + using (var em = new kmCommonLibsCore.Emails() { HandleOptOuts = false, SendMethod = enuSendMethod.OnsiteServer }) + { + // Parsing the submitted form to pull the relevant information + var cardType = isPostcard ? "Postcard" : "Plastic Card"; + var cardDesign = string.Empty; + if (designOne) + cardDesign = "A"; + else if (designTwo) + cardDesign = "B"; + else if (designThree) + cardDesign = "C"; + else if (designCustom) + cardDesign = "CUSTOM"; + + // Postcard or Plastic specific options + var customizationInfo = string.Empty; + if (isPostcard) + { + var verseChoice = string.Empty; + var sigChoice = string.Empty; + + if (verseOne) + verseChoice = "1"; + else if (verseTwo) + verseChoice = "2"; + else if (verseThree) + verseChoice = "3"; + + if (sigOne) + sigChoice = string.Format("Option D - From Your Friends At:
This component demonstrates showing data.
+ +@if (forecasts == null) +{ +Loading...
+} +else +{ +| Date | +Temp. (C) | +Temp. (F) | +Summary | +
|---|---|---|---|
| @forecast.Date.ToShortDateString() | +@forecast.TemperatureC | +@forecast.TemperatureF | +@forecast.Summary | +