Initial Version for Review
| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
{
 | 
			
		||||
  "version": 1,
 | 
			
		||||
  "isRoot": true,
 | 
			
		||||
  "tools": {}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,63 @@
 | 
			
		|||
###############################################################################
 | 
			
		||||
# Set default behavior to automatically normalize line endings.
 | 
			
		||||
###############################################################################
 | 
			
		||||
* text=auto
 | 
			
		||||
 | 
			
		||||
###############################################################################
 | 
			
		||||
# Set default behavior for command prompt diff.
 | 
			
		||||
#
 | 
			
		||||
# This is need for earlier builds of msysgit that does not have it on by
 | 
			
		||||
# default for csharp files.
 | 
			
		||||
# Note: This is only used by command line
 | 
			
		||||
###############################################################################
 | 
			
		||||
#*.cs         diff=csharp
 | 
			
		||||
 | 
			
		||||
###############################################################################
 | 
			
		||||
# Set the merge driver for project and solution files
 | 
			
		||||
#
 | 
			
		||||
# Merging from the command prompt will add diff markers to the files if there
 | 
			
		||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
 | 
			
		||||
# the diff markers are never inserted). Diff markers may cause the following 
 | 
			
		||||
# file extensions to fail to load in VS. An alternative would be to treat
 | 
			
		||||
# these files as binary and thus will always conflict and require user
 | 
			
		||||
# intervention with every merge. To do so, just uncomment the entries below
 | 
			
		||||
###############################################################################
 | 
			
		||||
#*.sln             merge=binary
 | 
			
		||||
#*.csproj        merge=binary
 | 
			
		||||
#*.vbproj        merge=binary
 | 
			
		||||
#*.vcxproj     merge=binary
 | 
			
		||||
#*.vcproj        merge=binary
 | 
			
		||||
#*.dbproj        merge=binary
 | 
			
		||||
#*.fsproj        merge=binary
 | 
			
		||||
#*.lsproj        merge=binary
 | 
			
		||||
#*.wixproj     merge=binary
 | 
			
		||||
#*.modelproj merge=binary
 | 
			
		||||
#*.sqlproj     merge=binary
 | 
			
		||||
#*.wwaproj     merge=binary
 | 
			
		||||
 | 
			
		||||
###############################################################################
 | 
			
		||||
# behavior for image files
 | 
			
		||||
#
 | 
			
		||||
# image files are treated as binary by default.
 | 
			
		||||
###############################################################################
 | 
			
		||||
#*.jpg     binary
 | 
			
		||||
#*.png     binary
 | 
			
		||||
#*.gif     binary
 | 
			
		||||
 | 
			
		||||
###############################################################################
 | 
			
		||||
# diff behavior for common document formats
 | 
			
		||||
# 
 | 
			
		||||
# Convert binary document formats to text before diffing them. This feature
 | 
			
		||||
# is only available from the command line. Turn it on by uncommenting the 
 | 
			
		||||
# entries below.
 | 
			
		||||
###############################################################################
 | 
			
		||||
#*.doc     diff=astextplain
 | 
			
		||||
#*.DOC     diff=astextplain
 | 
			
		||||
#*.docx    diff=astextplain
 | 
			
		||||
#*.DOCX    diff=astextplain
 | 
			
		||||
#*.dot     diff=astextplain
 | 
			
		||||
#*.DOT     diff=astextplain
 | 
			
		||||
#*.pdf     diff=astextplain
 | 
			
		||||
#*.PDF     diff=astextplain
 | 
			
		||||
#*.rtf     diff=astextplain
 | 
			
		||||
#*.RTF     diff=astextplain
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,363 @@
 | 
			
		|||
## Ignore Visual Studio temporary files, build results, and
 | 
			
		||||
## files generated by popular Visual Studio add-ons.
 | 
			
		||||
##
 | 
			
		||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
 | 
			
		||||
 | 
			
		||||
# User-specific files
 | 
			
		||||
*.rsuser
 | 
			
		||||
*.suo
 | 
			
		||||
*.user
 | 
			
		||||
*.userosscache
 | 
			
		||||
*.sln.docstates
 | 
			
		||||
 | 
			
		||||
# User-specific files (MonoDevelop/Xamarin Studio)
 | 
			
		||||
*.userprefs
 | 
			
		||||
 | 
			
		||||
# Mono auto generated files
 | 
			
		||||
mono_crash.*
 | 
			
		||||
 | 
			
		||||
# Build results
 | 
			
		||||
[Dd]ebug/
 | 
			
		||||
[Dd]ebugPublic/
 | 
			
		||||
[Rr]elease/
 | 
			
		||||
[Rr]eleases/
 | 
			
		||||
x64/
 | 
			
		||||
x86/
 | 
			
		||||
[Ww][Ii][Nn]32/
 | 
			
		||||
[Aa][Rr][Mm]/
 | 
			
		||||
[Aa][Rr][Mm]64/
 | 
			
		||||
bld/
 | 
			
		||||
[Bb]in/
 | 
			
		||||
[Oo]bj/
 | 
			
		||||
[Oo]ut/
 | 
			
		||||
[Ll]og/
 | 
			
		||||
[Ll]ogs/
 | 
			
		||||
 | 
			
		||||
# Visual Studio 2015/2017 cache/options directory
 | 
			
		||||
.vs/
 | 
			
		||||
# Uncomment if you have tasks that create the project's static files in wwwroot
 | 
			
		||||
#wwwroot/
 | 
			
		||||
 | 
			
		||||
# Visual Studio 2017 auto generated files
 | 
			
		||||
Generated\ Files/
 | 
			
		||||
 | 
			
		||||
# MSTest test Results
 | 
			
		||||
[Tt]est[Rr]esult*/
 | 
			
		||||
[Bb]uild[Ll]og.*
 | 
			
		||||
 | 
			
		||||
# NUnit
 | 
			
		||||
*.VisualState.xml
 | 
			
		||||
TestResult.xml
 | 
			
		||||
nunit-*.xml
 | 
			
		||||
 | 
			
		||||
# Build Results of an ATL Project
 | 
			
		||||
[Dd]ebugPS/
 | 
			
		||||
[Rr]eleasePS/
 | 
			
		||||
dlldata.c
 | 
			
		||||
 | 
			
		||||
# Benchmark Results
 | 
			
		||||
BenchmarkDotNet.Artifacts/
 | 
			
		||||
 | 
			
		||||
# .NET Core
 | 
			
		||||
project.lock.json
 | 
			
		||||
project.fragment.lock.json
 | 
			
		||||
artifacts/
 | 
			
		||||
 | 
			
		||||
# ASP.NET Scaffolding
 | 
			
		||||
ScaffoldingReadMe.txt
 | 
			
		||||
 | 
			
		||||
# StyleCop
 | 
			
		||||
StyleCopReport.xml
 | 
			
		||||
 | 
			
		||||
# Files built by Visual Studio
 | 
			
		||||
*_i.c
 | 
			
		||||
*_p.c
 | 
			
		||||
*_h.h
 | 
			
		||||
*.ilk
 | 
			
		||||
*.meta
 | 
			
		||||
*.obj
 | 
			
		||||
*.iobj
 | 
			
		||||
*.pch
 | 
			
		||||
*.pdb
 | 
			
		||||
*.ipdb
 | 
			
		||||
*.pgc
 | 
			
		||||
*.pgd
 | 
			
		||||
*.rsp
 | 
			
		||||
*.sbr
 | 
			
		||||
*.tlb
 | 
			
		||||
*.tli
 | 
			
		||||
*.tlh
 | 
			
		||||
*.tmp
 | 
			
		||||
*.tmp_proj
 | 
			
		||||
*_wpftmp.csproj
 | 
			
		||||
*.log
 | 
			
		||||
*.vspscc
 | 
			
		||||
*.vssscc
 | 
			
		||||
.builds
 | 
			
		||||
*.pidb
 | 
			
		||||
*.svclog
 | 
			
		||||
*.scc
 | 
			
		||||
 | 
			
		||||
# Chutzpah Test files
 | 
			
		||||
_Chutzpah*
 | 
			
		||||
 | 
			
		||||
# Visual C++ cache files
 | 
			
		||||
ipch/
 | 
			
		||||
*.aps
 | 
			
		||||
*.ncb
 | 
			
		||||
*.opendb
 | 
			
		||||
*.opensdf
 | 
			
		||||
*.sdf
 | 
			
		||||
*.cachefile
 | 
			
		||||
*.VC.db
 | 
			
		||||
*.VC.VC.opendb
 | 
			
		||||
 | 
			
		||||
# Visual Studio profiler
 | 
			
		||||
*.psess
 | 
			
		||||
*.vsp
 | 
			
		||||
*.vspx
 | 
			
		||||
*.sap
 | 
			
		||||
 | 
			
		||||
# Visual Studio Trace Files
 | 
			
		||||
*.e2e
 | 
			
		||||
 | 
			
		||||
# TFS 2012 Local Workspace
 | 
			
		||||
$tf/
 | 
			
		||||
 | 
			
		||||
# Guidance Automation Toolkit
 | 
			
		||||
*.gpState
 | 
			
		||||
 | 
			
		||||
# ReSharper is a .NET coding add-in
 | 
			
		||||
_ReSharper*/
 | 
			
		||||
*.[Rr]e[Ss]harper
 | 
			
		||||
*.DotSettings.user
 | 
			
		||||
 | 
			
		||||
# TeamCity is a build add-in
 | 
			
		||||
_TeamCity*
 | 
			
		||||
 | 
			
		||||
# DotCover is a Code Coverage Tool
 | 
			
		||||
*.dotCover
 | 
			
		||||
 | 
			
		||||
# AxoCover is a Code Coverage Tool
 | 
			
		||||
.axoCover/*
 | 
			
		||||
!.axoCover/settings.json
 | 
			
		||||
 | 
			
		||||
# Coverlet is a free, cross platform Code Coverage Tool
 | 
			
		||||
coverage*.json
 | 
			
		||||
coverage*.xml
 | 
			
		||||
coverage*.info
 | 
			
		||||
 | 
			
		||||
# Visual Studio code coverage results
 | 
			
		||||
*.coverage
 | 
			
		||||
*.coveragexml
 | 
			
		||||
 | 
			
		||||
# NCrunch
 | 
			
		||||
_NCrunch_*
 | 
			
		||||
.*crunch*.local.xml
 | 
			
		||||
nCrunchTemp_*
 | 
			
		||||
 | 
			
		||||
# MightyMoose
 | 
			
		||||
*.mm.*
 | 
			
		||||
AutoTest.Net/
 | 
			
		||||
 | 
			
		||||
# Web workbench (sass)
 | 
			
		||||
.sass-cache/
 | 
			
		||||
 | 
			
		||||
# Installshield output folder
 | 
			
		||||
[Ee]xpress/
 | 
			
		||||
 | 
			
		||||
# DocProject is a documentation generator add-in
 | 
			
		||||
DocProject/buildhelp/
 | 
			
		||||
DocProject/Help/*.HxT
 | 
			
		||||
DocProject/Help/*.HxC
 | 
			
		||||
DocProject/Help/*.hhc
 | 
			
		||||
DocProject/Help/*.hhk
 | 
			
		||||
DocProject/Help/*.hhp
 | 
			
		||||
DocProject/Help/Html2
 | 
			
		||||
DocProject/Help/html
 | 
			
		||||
 | 
			
		||||
# Click-Once directory
 | 
			
		||||
publish/
 | 
			
		||||
 | 
			
		||||
# Publish Web Output
 | 
			
		||||
*.[Pp]ublish.xml
 | 
			
		||||
*.azurePubxml
 | 
			
		||||
# Note: Comment the next line if you want to checkin your web deploy settings,
 | 
			
		||||
# but database connection strings (with potential passwords) will be unencrypted
 | 
			
		||||
*.pubxml
 | 
			
		||||
*.publishproj
 | 
			
		||||
 | 
			
		||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
 | 
			
		||||
# checkin your Azure Web App publish settings, but sensitive information contained
 | 
			
		||||
# in these scripts will be unencrypted
 | 
			
		||||
PublishScripts/
 | 
			
		||||
 | 
			
		||||
# NuGet Packages
 | 
			
		||||
*.nupkg
 | 
			
		||||
# NuGet Symbol Packages
 | 
			
		||||
*.snupkg
 | 
			
		||||
# The packages folder can be ignored because of Package Restore
 | 
			
		||||
**/[Pp]ackages/*
 | 
			
		||||
# except build/, which is used as an MSBuild target.
 | 
			
		||||
!**/[Pp]ackages/build/
 | 
			
		||||
# Uncomment if necessary however generally it will be regenerated when needed
 | 
			
		||||
#!**/[Pp]ackages/repositories.config
 | 
			
		||||
# NuGet v3's project.json files produces more ignorable files
 | 
			
		||||
*.nuget.props
 | 
			
		||||
*.nuget.targets
 | 
			
		||||
 | 
			
		||||
# Microsoft Azure Build Output
 | 
			
		||||
csx/
 | 
			
		||||
*.build.csdef
 | 
			
		||||
 | 
			
		||||
# Microsoft Azure Emulator
 | 
			
		||||
ecf/
 | 
			
		||||
rcf/
 | 
			
		||||
 | 
			
		||||
# Windows Store app package directories and files
 | 
			
		||||
AppPackages/
 | 
			
		||||
BundleArtifacts/
 | 
			
		||||
Package.StoreAssociation.xml
 | 
			
		||||
_pkginfo.txt
 | 
			
		||||
*.appx
 | 
			
		||||
*.appxbundle
 | 
			
		||||
*.appxupload
 | 
			
		||||
 | 
			
		||||
# Visual Studio cache files
 | 
			
		||||
# files ending in .cache can be ignored
 | 
			
		||||
*.[Cc]ache
 | 
			
		||||
# but keep track of directories ending in .cache
 | 
			
		||||
!?*.[Cc]ache/
 | 
			
		||||
 | 
			
		||||
# Others
 | 
			
		||||
ClientBin/
 | 
			
		||||
~$*
 | 
			
		||||
*~
 | 
			
		||||
*.dbmdl
 | 
			
		||||
*.dbproj.schemaview
 | 
			
		||||
*.jfm
 | 
			
		||||
*.pfx
 | 
			
		||||
*.publishsettings
 | 
			
		||||
orleans.codegen.cs
 | 
			
		||||
 | 
			
		||||
# Including strong name files can present a security risk
 | 
			
		||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
 | 
			
		||||
#*.snk
 | 
			
		||||
 | 
			
		||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
 | 
			
		||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
 | 
			
		||||
#bower_components/
 | 
			
		||||
 | 
			
		||||
# RIA/Silverlight projects
 | 
			
		||||
Generated_Code/
 | 
			
		||||
 | 
			
		||||
# Backup & report files from converting an old project file
 | 
			
		||||
# to a newer Visual Studio version. Backup files are not needed,
 | 
			
		||||
# because we have git ;-)
 | 
			
		||||
_UpgradeReport_Files/
 | 
			
		||||
Backup*/
 | 
			
		||||
UpgradeLog*.XML
 | 
			
		||||
UpgradeLog*.htm
 | 
			
		||||
ServiceFabricBackup/
 | 
			
		||||
*.rptproj.bak
 | 
			
		||||
 | 
			
		||||
# SQL Server files
 | 
			
		||||
*.mdf
 | 
			
		||||
*.ldf
 | 
			
		||||
*.ndf
 | 
			
		||||
 | 
			
		||||
# Business Intelligence projects
 | 
			
		||||
*.rdl.data
 | 
			
		||||
*.bim.layout
 | 
			
		||||
*.bim_*.settings
 | 
			
		||||
*.rptproj.rsuser
 | 
			
		||||
*- [Bb]ackup.rdl
 | 
			
		||||
*- [Bb]ackup ([0-9]).rdl
 | 
			
		||||
*- [Bb]ackup ([0-9][0-9]).rdl
 | 
			
		||||
 | 
			
		||||
# Microsoft Fakes
 | 
			
		||||
FakesAssemblies/
 | 
			
		||||
 | 
			
		||||
# GhostDoc plugin setting file
 | 
			
		||||
*.GhostDoc.xml
 | 
			
		||||
 | 
			
		||||
# Node.js Tools for Visual Studio
 | 
			
		||||
.ntvs_analysis.dat
 | 
			
		||||
node_modules/
 | 
			
		||||
 | 
			
		||||
# Visual Studio 6 build log
 | 
			
		||||
*.plg
 | 
			
		||||
 | 
			
		||||
# Visual Studio 6 workspace options file
 | 
			
		||||
*.opt
 | 
			
		||||
 | 
			
		||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
 | 
			
		||||
*.vbw
 | 
			
		||||
 | 
			
		||||
# Visual Studio LightSwitch build output
 | 
			
		||||
**/*.HTMLClient/GeneratedArtifacts
 | 
			
		||||
**/*.DesktopClient/GeneratedArtifacts
 | 
			
		||||
**/*.DesktopClient/ModelManifest.xml
 | 
			
		||||
**/*.Server/GeneratedArtifacts
 | 
			
		||||
**/*.Server/ModelManifest.xml
 | 
			
		||||
_Pvt_Extensions
 | 
			
		||||
 | 
			
		||||
# Paket dependency manager
 | 
			
		||||
.paket/paket.exe
 | 
			
		||||
paket-files/
 | 
			
		||||
 | 
			
		||||
# FAKE - F# Make
 | 
			
		||||
.fake/
 | 
			
		||||
 | 
			
		||||
# CodeRush personal settings
 | 
			
		||||
.cr/personal
 | 
			
		||||
 | 
			
		||||
# Python Tools for Visual Studio (PTVS)
 | 
			
		||||
__pycache__/
 | 
			
		||||
*.pyc
 | 
			
		||||
 | 
			
		||||
# Cake - Uncomment if you are using it
 | 
			
		||||
# tools/**
 | 
			
		||||
# !tools/packages.config
 | 
			
		||||
 | 
			
		||||
# Tabs Studio
 | 
			
		||||
*.tss
 | 
			
		||||
 | 
			
		||||
# Telerik's JustMock configuration file
 | 
			
		||||
*.jmconfig
 | 
			
		||||
 | 
			
		||||
# BizTalk build output
 | 
			
		||||
*.btp.cs
 | 
			
		||||
*.btm.cs
 | 
			
		||||
*.odx.cs
 | 
			
		||||
*.xsd.cs
 | 
			
		||||
 | 
			
		||||
# OpenCover UI analysis results
 | 
			
		||||
OpenCover/
 | 
			
		||||
 | 
			
		||||
# Azure Stream Analytics local run output
 | 
			
		||||
ASALocalRun/
 | 
			
		||||
 | 
			
		||||
# MSBuild Binary and Structured Log
 | 
			
		||||
*.binlog
 | 
			
		||||
 | 
			
		||||
# NVidia Nsight GPU debugger configuration file
 | 
			
		||||
*.nvuser
 | 
			
		||||
 | 
			
		||||
# MFractors (Xamarin productivity tool) working folder
 | 
			
		||||
.mfractor/
 | 
			
		||||
 | 
			
		||||
# Local History for Visual Studio
 | 
			
		||||
.localhistory/
 | 
			
		||||
 | 
			
		||||
# BeatPulse healthcheck temp database
 | 
			
		||||
healthchecksdb
 | 
			
		||||
 | 
			
		||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
 | 
			
		||||
MigrationBackup/
 | 
			
		||||
 | 
			
		||||
# Ionide (cross platform F# VS Code tools) working folder
 | 
			
		||||
.ionide/
 | 
			
		||||
 | 
			
		||||
# Fody - auto-generated XML schema
 | 
			
		||||
FodyWeavers.xsd
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
@* @using static Microsoft.AspNetCore.Components.Web.RenderMode
 | 
			
		||||
@rendermode InteractiveServer
 | 
			
		||||
*@
 | 
			
		||||
<CascadingValue Value="this">
 | 
			
		||||
    @ChildContent
 | 
			
		||||
</CascadingValue>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,156 @@
 | 
			
		|||
using Microsoft.AspNetCore.Components;
 | 
			
		||||
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System.Text.Json;
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
 | 
			
		||||
namespace WinterBestCustomerWebForm.AppState;
 | 
			
		||||
 | 
			
		||||
public partial class CascadingAppState : ComponentBase, IAppState
 | 
			
		||||
{
 | 
			
		||||
    private readonly string StorageKey = "SummerBestEnrollment-KeyMotive";
 | 
			
		||||
    [Parameter]
 | 
			
		||||
    public RenderFragment? ChildContent { get; set; }
 | 
			
		||||
    [Inject]
 | 
			
		||||
    ProtectedLocalStorage? localStorage { get; set; } = default!;
 | 
			
		||||
    //[Inject]
 | 
			
		||||
    //IHttpContextAccessor? httpContextAccessor { get; set; } = default!;
 | 
			
		||||
    [CascadingParameter] HttpContext? httpContext { get; set; } = default!;
 | 
			
		||||
 | 
			
		||||
    bool isLoaded = false;
 | 
			
		||||
 | 
			
		||||
    public Guid SessionId { get; set; } = Guid.Empty;
 | 
			
		||||
 | 
			
		||||
    public bool isInit { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
    //public CascadingAppState()
 | 
			
		||||
    //{
 | 
			
		||||
    //    Load();
 | 
			
		||||
    //}
 | 
			
		||||
 | 
			
		||||
    private string? _myIpAddress = string.Empty;
 | 
			
		||||
    public string? myIpAddress
 | 
			
		||||
    {
 | 
			
		||||
        get => _myIpAddress;
 | 
			
		||||
        set
 | 
			
		||||
        {
 | 
			
		||||
            _myIpAddress = value;
 | 
			
		||||
            Save();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private DateTimeOffset _DateCreated = DateTimeOffset.Now;
 | 
			
		||||
    public DateTimeOffset DateCreated
 | 
			
		||||
    {
 | 
			
		||||
        get => _DateCreated;
 | 
			
		||||
        set
 | 
			
		||||
        {
 | 
			
		||||
            _DateCreated = value;
 | 
			
		||||
            Save();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    private DateTimeOffset _DateExpires = DateTimeOffset.Now;
 | 
			
		||||
    public DateTimeOffset DateExpires
 | 
			
		||||
    {
 | 
			
		||||
        get => _DateExpires;
 | 
			
		||||
        set
 | 
			
		||||
        {
 | 
			
		||||
            _DateExpires = value;
 | 
			
		||||
            Save();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O) / (o) (O)
 | 
			
		||||
 | 
			
		||||
    protected override async Task OnAfterRenderAsync(bool firstRender)
 | 
			
		||||
    {
 | 
			
		||||
        await base.OnAfterRenderAsync(firstRender);
 | 
			
		||||
        if (firstRender)
 | 
			
		||||
        {
 | 
			
		||||
            await LoadAsync();
 | 
			
		||||
            StateHasChanged();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void Save()
 | 
			
		||||
    {
 | 
			
		||||
        new Task(async () =>
 | 
			
		||||
        {
 | 
			
		||||
            await SaveAsync();
 | 
			
		||||
        }).Start();
 | 
			
		||||
    } //Save
 | 
			
		||||
 | 
			
		||||
    public async Task SaveAsync()
 | 
			
		||||
    {
 | 
			
		||||
        if (!isLoaded) return;
 | 
			
		||||
 | 
			
		||||
        // serialize 
 | 
			
		||||
        var state = (IAppState)this;
 | 
			
		||||
        var json = JsonSerializer.Serialize(state);
 | 
			
		||||
        // save
 | 
			
		||||
        await localStorage.SetAsync(StorageKey, json);
 | 
			
		||||
    } //SaveAsync
 | 
			
		||||
 | 
			
		||||
    private void Load()
 | 
			
		||||
    {
 | 
			
		||||
        new Task(async () =>
 | 
			
		||||
        {
 | 
			
		||||
            await LoadAsync();
 | 
			
		||||
        }).Start();
 | 
			
		||||
    } //Load
 | 
			
		||||
 | 
			
		||||
    public async Task LoadAsync()
 | 
			
		||||
    {
 | 
			
		||||
        string remoteIpAddr = string.Empty;
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            //remoteIpAddr = httpContextAccessor.HttpContext?.Connection.RemoteIpAddress?.ToString() ?? string.Empty;
 | 
			
		||||
            remoteIpAddr = this.httpContext?.Connection.RemoteIpAddress?.ToString() ?? "Not Set";
 | 
			
		||||
            var data = await localStorage.GetAsync<string>(StorageKey);
 | 
			
		||||
            var state = JsonSerializer.Deserialize<MdlAppState>(data.Value);
 | 
			
		||||
 | 
			
		||||
            if (state != null)
 | 
			
		||||
            {
 | 
			
		||||
                if (DateTimeOffset.Now < state.DateExpires)
 | 
			
		||||
                {
 | 
			
		||||
                    // decide whether to set properties manually or with reflection
 | 
			
		||||
 | 
			
		||||
                    // comment to set properties manually
 | 
			
		||||
                    //this.Message = state.Message;
 | 
			
		||||
                    //this.Count = state.Count;
 | 
			
		||||
 | 
			
		||||
                    // set properties using Reflaction
 | 
			
		||||
                    var t = typeof(IAppState);
 | 
			
		||||
                    //var props = t.GetProperties();
 | 
			
		||||
                    PropertyInfo[] props = t.GetProperties();
 | 
			
		||||
                    foreach (var prop in props)
 | 
			
		||||
                    {
 | 
			
		||||
                        //if (!Regex.IsMatch(prop.Name, "isInit|SessionId|"))
 | 
			
		||||
                        {
 | 
			
		||||
                            var value = prop.GetValue(state, null);
 | 
			
		||||
                            prop.SetValue(this, value, null);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        catch (Exception ex)
 | 
			
		||||
        {
 | 
			
		||||
            // do something
 | 
			
		||||
        }
 | 
			
		||||
        isLoaded = true;
 | 
			
		||||
        DateExpires = DateTimeOffset.Now.AddHours(36);
 | 
			
		||||
        myIpAddress = remoteIpAddr;
 | 
			
		||||
        if (!isInit)
 | 
			
		||||
        {
 | 
			
		||||
            DateCreated = DateTimeOffset.Now;
 | 
			
		||||
            SessionId = Guid.NewGuid();
 | 
			
		||||
            isInit = true;
 | 
			
		||||
            await SaveAsync();
 | 
			
		||||
        }
 | 
			
		||||
        await InvokeAsync(() =>
 | 
			
		||||
        {
 | 
			
		||||
            StateHasChanged();
 | 
			
		||||
        });
 | 
			
		||||
    } //LoadAsync
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
namespace WinterBestCustomerWebForm.AppState;
 | 
			
		||||
 | 
			
		||||
public interface IAppState
 | 
			
		||||
{
 | 
			
		||||
    bool isInit { get; set; }
 | 
			
		||||
    string? myIpAddress { get; set; }
 | 
			
		||||
    Guid SessionId { get; set; }
 | 
			
		||||
    DateTimeOffset DateCreated { get; set; }
 | 
			
		||||
    DateTimeOffset DateExpires { get; set; }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
namespace WinterBestCustomerWebForm.AppState;
 | 
			
		||||
 | 
			
		||||
public class MdlAppState : IAppState
 | 
			
		||||
{
 | 
			
		||||
    public bool isInit { get; set; }
 | 
			
		||||
    public string? myIpAddress { get; set; }
 | 
			
		||||
    public Guid SessionId { get; set; }
 | 
			
		||||
    public DateTimeOffset DateCreated { get; set; }
 | 
			
		||||
    public DateTimeOffset DateExpires { get; set; }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
namespace WinterBestCustomerWebForm.ClassObj;
 | 
			
		||||
 | 
			
		||||
public class IPAddressService
 | 
			
		||||
{
 | 
			
		||||
    public const string TokenName = "IPAddress";
 | 
			
		||||
 | 
			
		||||
    public string RemoteIpAddress { get; set; } = "Not Set";
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
namespace WinterBestCustomerWebForm;
 | 
			
		||||
 | 
			
		||||
public class MdlSessionInfo
 | 
			
		||||
{
 | 
			
		||||
    public const string KEY_IPADDRESS = "IPAddress";
 | 
			
		||||
    public string IPAddress { get; set; } = null!;
 | 
			
		||||
    public bool isInit { get; set; } = false;
 | 
			
		||||
    public DateTimeOffset DateCreated { get; set; } = DateTimeOffset.MinValue;
 | 
			
		||||
 | 
			
		||||
    public MdlSessionInfo()
 | 
			
		||||
    {
 | 
			
		||||
        // Have to have a blank ctor here for ProtectedSessionStorage
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,123 @@
 | 
			
		|||
@implements IDisposable
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
 | 
			
		||||
<head>
 | 
			
		||||
    <meta charset="utf-8" />
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 | 
			
		||||
    <base href="/" />
 | 
			
		||||
    <meta name="description" content="KeyMotive's Summer Best Customer Program Enrollment" />
 | 
			
		||||
    <meta name="author" content="KeyMotive LLC" />
 | 
			
		||||
    <meta name="Charset" content="US-ASCII" />
 | 
			
		||||
    <meta name="Distribution" content="Global" />
 | 
			
		||||
    <meta name="Rating" content="General" />
 | 
			
		||||
    <meta name="Robots" content="INDEX,FOLLOW" />
 | 
			
		||||
    <meta name="Revisit-after" content="14 Days" />
 | 
			
		||||
    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />
 | 
			
		||||
    <link href='https://fonts.googleapis.com/css?family=Roboto|Handlee|Candal|Exo 2|Armata|Poppins|Kalam:wght@300&display=swap' rel='stylesheet' type='text/css' />
 | 
			
		||||
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css" integrity="sha512-jnSuA4Ss2PkkikSOLtYs8BlYIeeIK1h99ty4YfvRPAlzr377vr3CXDb7sb7eEEBYjDtcYj+AjBH3FLv5uSJuXg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
 | 
			
		||||
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
 | 
			
		||||
    <link rel="stylesheet" href="app.css" />
 | 
			
		||||
    <link rel="stylesheet" href="WinterBestCustomerWebForm.styles.css" />
 | 
			
		||||
    <link rel="icon" type="image/png" sizes="512x512" href="/img/favico-512.png">
 | 
			
		||||
    <link rel="icon" type="image/png" sizes="256x256" href="/img/favico-256.png">
 | 
			
		||||
    <link rel="icon" type="image/png" sizes="128x128" href="/img/favico-128.png">
 | 
			
		||||
    <link rel="icon" type="image/png" sizes="64x64" href="/img/favico-64.png">
 | 
			
		||||
    <link rel="icon" type="image/png" sizes="32x32" href="/img/favico-32.png">
 | 
			
		||||
    <style type="text/css">
 | 
			
		||||
        div.container {
 | 
			
		||||
        background-color: #fff;
 | 
			
		||||
        min-height: 100vh;
 | 
			
		||||
        }
 | 
			
		||||
    </style>
 | 
			
		||||
    @* <HeadOutlet @rendermode="@(new InteractiveServerRenderMode(false))" /> *@
 | 
			
		||||
    <HeadOutlet @rendermode="InteractiveServer" />
 | 
			
		||||
    <link rel="stylesheet" href="https://blazor.cdn.telerik.com/blazor/6.2.0/kendo-theme-bootstrap/swatches/bootstrap-main.css" />
 | 
			
		||||
    <script src="https://blazor.cdn.telerik.com/blazor/6.2.0/telerik-blazor.min.js" defer></script>
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body>
 | 
			
		||||
    <!-- Turn off pre-rendering -->
 | 
			
		||||
    @* <Routes @rendermode="@(new InteractiveServerRenderMode(false))" /> *@
 | 
			
		||||
    <Routes @rendermode="InteractiveServer" />
 | 
			
		||||
    <script src="_framework/blazor.web.js"></script>
 | 
			
		||||
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js" integrity="sha512-7Pi/otdlbbCR+LnW+F7PwFcSDJOuUJB3OxtEHbg4vSMvzvJjde4Po1v4BR9Gdc9aXNUNFVUY+SK51wWT8WF0Gg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
 | 
			
		||||
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/js/all.min.js" integrity="sha512-u3fPA7V8qQmhBPNT5quvaXVa1mnnLSXUep5PS1qo5NRzHwG19aHmNJnj1Q8hpA/nBWZtZD4r4AX6YOt5ynLN2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
        window.WriteCookie = {
 | 
			
		||||
        WriteCookie: function (name, value, days) {
 | 
			
		||||
        var expires;
 | 
			
		||||
        if (days) {
 | 
			
		||||
        var date = new Date();
 | 
			
		||||
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
 | 
			
		||||
        expires = "; expires=" + date.toGMTString();
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
        expires = "";
 | 
			
		||||
        }
 | 
			
		||||
        document.cookie = name + "=" + value + expires + "; path=/";
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
        window.ReadCookie = {
 | 
			
		||||
        ReadCookie: function (cname) {
 | 
			
		||||
        var name = cname + "=";
 | 
			
		||||
        var decodedCookie = decodeURIComponent(document.cookie);
 | 
			
		||||
        var ca = decodedCookie.split(';');
 | 
			
		||||
        for (var i = 0; i < ca.length; i++) {
 | 
			
		||||
        var c = ca[i];
 | 
			
		||||
        while (c.charAt(0) == ' ') {
 | 
			
		||||
        c = c.substring(1);
 | 
			
		||||
        }
 | 
			
		||||
        if (c.indexOf(name) == 0) {
 | 
			
		||||
        return c.substring(name.length, c.length);
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
        return "";
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
    </script>
 | 
			
		||||
    <pre>@errMsg</pre>
 | 
			
		||||
@*     @if (appState != null)
 | 
			
		||||
    {
 | 
			
		||||
        <pre style="font-size:.8em">
 | 
			
		||||
            SessionId: @appState.SessionId
 | 
			
		||||
            DateCreated: @appState.DateCreated
 | 
			
		||||
            DateExpires: @appState.DateExpires
 | 
			
		||||
            IPAddress: @appState.myIpAddress
 | 
			
		||||
        </pre>
 | 
			
		||||
    } *@
 | 
			
		||||
</body>
 | 
			
		||||
 | 
			
		||||
</html>
 | 
			
		||||
@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<string>(ClassObj.IPAddressService.TokenName, this.RemoteIpAddress);
 | 
			
		||||
        return Task.CompletedTask;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void IDisposable.Dispose()
 | 
			
		||||
    {
 | 
			
		||||
        _persistingSubscription?.Dispose();
 | 
			
		||||
    }
 | 
			
		||||
#endregion
 | 
			
		||||
 | 
			
		||||
    private string errMsg = string.Empty;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
@using ClassObj
 | 
			
		||||
 | 
			
		||||
Welcome, @RemoteIpAddress!
 | 
			
		||||
 | 
			
		||||
@code {
 | 
			
		||||
    [Inject] public IPAddressService IPAddressService { get; set; } = default!;
 | 
			
		||||
    [Inject] public PersistentComponentState ApplicationState { get; set; } = default!;
 | 
			
		||||
 | 
			
		||||
    private bool _subsequentRender;
 | 
			
		||||
    private const string TokenName = "IPAddress";
 | 
			
		||||
    private string RemoteIpAddress = "Not Set";
 | 
			
		||||
 | 
			
		||||
    // Short circuit all the lifecycle stuff - we don't need it
 | 
			
		||||
    public override Task SetParametersAsync(ParameterView parameters)
 | 
			
		||||
    {
 | 
			
		||||
        if (_subsequentRender)
 | 
			
		||||
            return Task.CompletedTask;
 | 
			
		||||
 | 
			
		||||
        // if not prerender, try and get the persisted value
 | 
			
		||||
        if (this.ApplicationState.TryTakeFromJson<string>(IPAddressService.TokenName, out var address))
 | 
			
		||||
        {
 | 
			
		||||
            this.RemoteIpAddress = address ?? "Not Set";
 | 
			
		||||
            this.IPAddressService.RemoteIpAddress = this.RemoteIpAddress;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        _subsequentRender = true;
 | 
			
		||||
        return Task.CompletedTask;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
@inherits LayoutComponentBase
 | 
			
		||||
 | 
			
		||||
<TelerikRootComponent>
 | 
			
		||||
        @Body
 | 
			
		||||
</TelerikRootComponent>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,96 @@
 | 
			
		|||
.page {
 | 
			
		||||
        position: relative;
 | 
			
		||||
        display: flex;
 | 
			
		||||
        flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
main {
 | 
			
		||||
        flex: 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.sidebar {
 | 
			
		||||
        background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.top-row {
 | 
			
		||||
        background-color: #f7f7f7;
 | 
			
		||||
        border-bottom: 1px solid #d6d5d5;
 | 
			
		||||
        justify-content: flex-end;
 | 
			
		||||
        height: 3.5rem;
 | 
			
		||||
        display: flex;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
        .top-row ::deep a, .top-row ::deep .btn-link {
 | 
			
		||||
                white-space: nowrap;
 | 
			
		||||
                margin-left: 1.5rem;
 | 
			
		||||
                text-decoration: none;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
 | 
			
		||||
                text-decoration: underline;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .top-row ::deep a:first-child {
 | 
			
		||||
                overflow: hidden;
 | 
			
		||||
                text-overflow: ellipsis;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@media (max-width: 640.98px) {
 | 
			
		||||
        .top-row {
 | 
			
		||||
                justify-content: space-between;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .top-row ::deep a, .top-row ::deep .btn-link {
 | 
			
		||||
                margin-left: 0;
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media (min-width: 641px) {
 | 
			
		||||
        .page {
 | 
			
		||||
                flex-direction: row;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .sidebar {
 | 
			
		||||
                width: 250px;
 | 
			
		||||
                height: 100vh;
 | 
			
		||||
                position: sticky;
 | 
			
		||||
                top: 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .top-row {
 | 
			
		||||
                position: sticky;
 | 
			
		||||
                top: 0;
 | 
			
		||||
                z-index: 1;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .top-row.auth ::deep a:first-child {
 | 
			
		||||
                flex: 1;
 | 
			
		||||
                text-align: right;
 | 
			
		||||
                width: 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .top-row, article {
 | 
			
		||||
                padding-left: 2rem !important;
 | 
			
		||||
                padding-right: 1.5rem !important;
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#blazor-error-ui {
 | 
			
		||||
        background: lightyellow;
 | 
			
		||||
        bottom: 0;
 | 
			
		||||
        box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
 | 
			
		||||
        display: none;
 | 
			
		||||
        left: 0;
 | 
			
		||||
        padding: 0.6rem 1.25rem 0.7rem 1.25rem;
 | 
			
		||||
        position: fixed;
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        z-index: 1000;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
        #blazor-error-ui .dismiss {
 | 
			
		||||
                cursor: pointer;
 | 
			
		||||
                position: absolute;
 | 
			
		||||
                right: 0.75rem;
 | 
			
		||||
                top: 0.5rem;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,30 @@
 | 
			
		|||
<div class="top-row ps-3 navbar navbar-dark">
 | 
			
		||||
        <div class="container-fluid">
 | 
			
		||||
                <a class="navbar-brand" href="">WinterBestCustomerWebForm</a>
 | 
			
		||||
        </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
 | 
			
		||||
 | 
			
		||||
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
 | 
			
		||||
        <nav class="flex-column">
 | 
			
		||||
                <div class="nav-item px-3">
 | 
			
		||||
                        <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
 | 
			
		||||
                                <span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
 | 
			
		||||
                        </NavLink>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="nav-item px-3">
 | 
			
		||||
                        <NavLink class="nav-link" href="counter">
 | 
			
		||||
                                <span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
 | 
			
		||||
                        </NavLink>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="nav-item px-3">
 | 
			
		||||
                        <NavLink class="nav-link" href="weather">
 | 
			
		||||
                                <span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Weather
 | 
			
		||||
                        </NavLink>
 | 
			
		||||
                </div>
 | 
			
		||||
        </nav>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,105 @@
 | 
			
		|||
.navbar-toggler {
 | 
			
		||||
        appearance: none;
 | 
			
		||||
        cursor: pointer;
 | 
			
		||||
        width: 3.5rem;
 | 
			
		||||
        height: 2.5rem;
 | 
			
		||||
        color: white;
 | 
			
		||||
        position: absolute;
 | 
			
		||||
        top: 0.5rem;
 | 
			
		||||
        right: 1rem;
 | 
			
		||||
        border: 1px solid rgba(255, 255, 255, 0.1);
 | 
			
		||||
        background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-toggler:checked {
 | 
			
		||||
        background-color: rgba(255, 255, 255, 0.5);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.top-row {
 | 
			
		||||
        height: 3.5rem;
 | 
			
		||||
        background-color: rgba(0,0,0,0.4);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-brand {
 | 
			
		||||
        font-size: 1.1rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bi {
 | 
			
		||||
        display: inline-block;
 | 
			
		||||
        position: relative;
 | 
			
		||||
        width: 1.25rem;
 | 
			
		||||
        height: 1.25rem;
 | 
			
		||||
        margin-right: 0.75rem;
 | 
			
		||||
        top: -1px;
 | 
			
		||||
        background-size: cover;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bi-house-door-fill-nav-menu {
 | 
			
		||||
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bi-plus-square-fill-nav-menu {
 | 
			
		||||
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.bi-list-nested-nav-menu {
 | 
			
		||||
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.nav-item {
 | 
			
		||||
        font-size: 0.9rem;
 | 
			
		||||
        padding-bottom: 0.5rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
        .nav-item:first-of-type {
 | 
			
		||||
                padding-top: 1rem;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .nav-item:last-of-type {
 | 
			
		||||
                padding-bottom: 1rem;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .nav-item ::deep .nav-link {
 | 
			
		||||
                color: #d7d7d7;
 | 
			
		||||
                background: none;
 | 
			
		||||
                border: none;
 | 
			
		||||
                border-radius: 4px;
 | 
			
		||||
                height: 3rem;
 | 
			
		||||
                display: flex;
 | 
			
		||||
                align-items: center;
 | 
			
		||||
                line-height: 3rem;
 | 
			
		||||
                width: 100%;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
.nav-item ::deep a.active {
 | 
			
		||||
        background-color: rgba(255,255,255,0.37);
 | 
			
		||||
        color: white;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.nav-item ::deep .nav-link:hover {
 | 
			
		||||
        background-color: rgba(255,255,255,0.1);
 | 
			
		||||
        color: white;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.nav-scrollable {
 | 
			
		||||
        display: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-toggler:checked ~ .nav-scrollable {
 | 
			
		||||
        display: block;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media (min-width: 641px) {
 | 
			
		||||
        .navbar-toggler {
 | 
			
		||||
                display: none;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .nav-scrollable {
 | 
			
		||||
                /* Never collapse the sidebar for wide screens */
 | 
			
		||||
                display: block;
 | 
			
		||||
 | 
			
		||||
                /* Allow sidebar to scroll for tall menus */
 | 
			
		||||
                height: calc(100vh - 3.5rem);
 | 
			
		||||
                overflow-y: auto;
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,36 @@
 | 
			
		|||
@page "/Error"
 | 
			
		||||
@using System.Diagnostics
 | 
			
		||||
 | 
			
		||||
<PageTitle>Error</PageTitle>
 | 
			
		||||
 | 
			
		||||
<h1 class="text-danger">Error.</h1>
 | 
			
		||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
 | 
			
		||||
 | 
			
		||||
@if (ShowRequestId)
 | 
			
		||||
{
 | 
			
		||||
    <p>
 | 
			
		||||
        <strong>Request ID:</strong> <code>@RequestId</code>
 | 
			
		||||
    </p>
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
<h3>Development Mode</h3>
 | 
			
		||||
<p>
 | 
			
		||||
    Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
    <strong>The Development environment shouldn't be enabled for deployed applications.</strong>
 | 
			
		||||
    It can result in displaying sensitive information from exceptions to end users.
 | 
			
		||||
    For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
 | 
			
		||||
    and restarting the app.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
@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;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,464 @@
 | 
			
		|||
@rendermode InteractiveServer
 | 
			
		||||
@inject PersistentComponentState ApplicationState
 | 
			
		||||
@inject ClassObj.IPAddressService IpAddressService
 | 
			
		||||
@page "/"
 | 
			
		||||
 | 
			
		||||
<PageTitle>Welcome</PageTitle>
 | 
			
		||||
 | 
			
		||||
@if (ProgramClosed)
 | 
			
		||||
{
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            <div class="col-12 text-center mt-5">
 | 
			
		||||
                <h1>Thank you for your interest!</h1>
 | 
			
		||||
                <p>Unfortunately, the enrollment period for our Winter Campaign has drawn to a close.</p>
 | 
			
		||||
                <p>Stay tuned for more great campaigns in the future!</p>
 | 
			
		||||
                <p><i class="fa-solid fa-heart"></i></p>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-12 text-center">
 | 
			
		||||
                <img class="img-fluid" src="/img/34d1685e-d655-421b-aef8-e077140534f9.png" alt="Thank You!" />
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
}
 | 
			
		||||
else if (ShowWizard)
 | 
			
		||||
{
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            <div class="col-12">
 | 
			
		||||
                <TelerikWizard @bind-Value="@Value" OnFinish="OnFinishHandler" Width="100%" Height="95vh" Class="sbWizard" StepperPosition=WizardStepperPosition.Top>
 | 
			
		||||
                    <WizardSteps>
 | 
			
		||||
                        <WizardStep Label="Introduction" Icon="@SvgIcon.Globe" Valid="@IsAudienceChoiceValid">
 | 
			
		||||
                            <Content>
 | 
			
		||||
                                <TelerikForm Model="@cardType" @ref="@IntroForm">
 | 
			
		||||
                                    <FormItems>
 | 
			
		||||
                                        <FormItem>
 | 
			
		||||
                                            <Template>
 | 
			
		||||
                                                <div class="container">
 | 
			
		||||
                                                    <div class="row">
 | 
			
		||||
                                                        <div class="col-12 px-sm-5 mb-2">
 | 
			
		||||
                                                            <h1>KeyMotive's Winter Best Customer Program</h1>
 | 
			
		||||
                                                            <div class="px-sm-5 mb-2">
 | 
			
		||||
                                                                <p>It's time for our Winter Best Customer Program!<br />If you're looking to finish off the year with a bang, then this is the campaign for you!</p>
 | 
			
		||||
                                                                <p>
 | 
			
		||||
                                                                    Using this wizard, decide what media you'd like to mail, personalize your selection, and choose from a few suggested designs (or request a custom design from our
 | 
			
		||||
                                                                    creative team), and that's it!
 | 
			
		||||
                                                                </p>
 | 
			
		||||
                                                                <p>Let us handle the rest!</p>
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                            <div>
 | 
			
		||||
                                                                <img src="/img/HomeCollage.png" class="img-fluid" />
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                            <br />
 | 
			
		||||
                                                            <div class="px-sm-5 mb-2">
 | 
			
		||||
                                                                Our campaign focuses on rewarding your <strong class="text-primary">Very Best Customers</strong> for their loyalty and reminding them of what makes your shop great.
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                    </div>
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            </Template>
 | 
			
		||||
                                        </FormItem>
 | 
			
		||||
                                    </FormItems>
 | 
			
		||||
                                    <FormButtons>
 | 
			
		||||
                                        @* Need this here to avoid addition of random submit button *@
 | 
			
		||||
                                    </FormButtons>
 | 
			
		||||
                                </TelerikForm>
 | 
			
		||||
                            </Content>
 | 
			
		||||
                        </WizardStep>
 | 
			
		||||
                        @*                                                                        *@
 | 
			
		||||
                        @* Step 1 - greeting card vs postcard *@
 | 
			
		||||
                        @*                                                                        *@
 | 
			
		||||
                        <WizardStep Label="Card Type" OnChange="@OnCardChoiceStepChange">
 | 
			
		||||
                            <Content>
 | 
			
		||||
                                <TelerikForm Model="@cardType" @ref="@cardTypeForm">
 | 
			
		||||
                                    <FormItems>
 | 
			
		||||
                                        <FormItem>
 | 
			
		||||
                                            <Template>
 | 
			
		||||
                                                <div class="container">
 | 
			
		||||
                                                    <div class="row">
 | 
			
		||||
                                                        <div class="col-12">
 | 
			
		||||
                                                            <h1 class="text-center">Step 1 - Choose a Card Type</h1>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                        <div class="col-12 text-center mb-3">
 | 
			
		||||
                                                            <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single">
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@isGreetingCard">Greeting Card</ButtonGroupToggleButton>
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@isPostcard">Postcard</ButtonGroupToggleButton>
 | 
			
		||||
                                                            </TelerikButtonGroup>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                        @* Preview information about the selected card type*@
 | 
			
		||||
                                                        @if (isGreetingCard)
 | 
			
		||||
                                                        {
 | 
			
		||||
                                                            <div class="col-sm-4 mb-3 text-start">
 | 
			
		||||
                                                                <h4>Eye-catching Personalized Greeting Card!</h4>
 | 
			
		||||
                                                                <ul>
 | 
			
		||||
                                                                    <li>Unique and bold presentation!</li>
 | 
			
		||||
                                                                    <li>Large trifold piece</li>
 | 
			
		||||
                                                                    <li>Coupons are easy to remove, offering great convenience for your customers!</li>
 | 
			
		||||
                                                                    <li>Leave it to us - we select, print, sort and mail for just <strong class="text-primary text-nowrap">$1.14 each</strong></li>
 | 
			
		||||
                                                                </ul>
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                            <div class="col-sm-8 text-center mb-3">
 | 
			
		||||
                                                                <img class="img-fluid" src="/img/GreetingCards.png" />
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        }
 | 
			
		||||
                                                        else
 | 
			
		||||
                                                        {
 | 
			
		||||
                                                            <div class="col-sm-4 mb-3 text-start">
 | 
			
		||||
                                                                <h4>Premium Postcard Really Stands Out in the Mailbox</h4>
 | 
			
		||||
                                                                <ul>
 | 
			
		||||
                                                                    <li>Premium paper, Jumbo-Sized (8½ x 6 inches)</li>
 | 
			
		||||
                                                                    <li>UV gloss-coated</li>
 | 
			
		||||
                                                                    <li>Choose from our selection, or ask for a custom design!</li>
 | 
			
		||||
                                                                    <li>Full service - select, print, sort, mail for just <strong class="text-primary text-nowrap">92¢ each</strong></li>
 | 
			
		||||
                                                                </ul>
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                            <div class="col-sm-8 text-center mb-3">
 | 
			
		||||
                                                                <img class="img-fluid" src="/img/Postcards.png" />
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        }
 | 
			
		||||
                                                    </div>
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            </Template>
 | 
			
		||||
                                        </FormItem>
 | 
			
		||||
                                    </FormItems>
 | 
			
		||||
                                    <FormButtons>
 | 
			
		||||
                                        @* Need this here to avoid addition of random submit button *@
 | 
			
		||||
                                    </FormButtons>
 | 
			
		||||
                                </TelerikForm>
 | 
			
		||||
                            </Content>
 | 
			
		||||
                        </WizardStep>
 | 
			
		||||
                        @*                                                                *@
 | 
			
		||||
                        @* Step 2 - selecting card design *@
 | 
			
		||||
                        @*                                                                *@
 | 
			
		||||
                        <WizardStep Label="Card Design" OnChange="@OnDesignStepChange">
 | 
			
		||||
                            <Content>
 | 
			
		||||
                                <TelerikForm Model="@custOptions" @ref="@customizationForm">
 | 
			
		||||
                                    <FormValidation>
 | 
			
		||||
                                        <DataAnnotationsValidator></DataAnnotationsValidator>
 | 
			
		||||
                                    </FormValidation>
 | 
			
		||||
                                    <FormItems>
 | 
			
		||||
                                        <FormItem>
 | 
			
		||||
                                            <Template>
 | 
			
		||||
                                                <div class="container">
 | 
			
		||||
                                                    <div class="row">
 | 
			
		||||
                                                        <div class="col-12">
 | 
			
		||||
                                                            <h1 class="text-center">Choose a Design</h1>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                        <div class="col-12 text-center mb-3">
 | 
			
		||||
                                                            @* Button logic *@
 | 
			
		||||
                                                            <div class="text-center">
 | 
			
		||||
                                                                <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single">
 | 
			
		||||
                                                                    @if (isGreetingCard)
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designOne">Greeting Card 1</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designTwo">Greeting Card 2</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designThree">Greeting Card 3</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designFour">Greeting Card 4</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designCustom">Custom</ButtonGroupToggleButton>
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                    else
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designOne">Postcard 1</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designTwo">Postcard 2</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designThree">Postcard 3</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designFour">Postcard 4</ButtonGroupToggleButton>
 | 
			
		||||
                                                                        <ButtonGroupToggleButton @bind-Selected="@designCustom">Custom</ButtonGroupToggleButton>
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                </TelerikButtonGroup>
 | 
			
		||||
                                                                <br /><br />
 | 
			
		||||
                                                                @* Card preview logic *@
 | 
			
		||||
                                                                @if (designOne)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    @if (isPostcard)
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Postcard1.jpg" class="img-fluid" alt="Automotive" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                    else
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Greeting1.png" class="img-fluid" alt="Autmotive" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (designTwo)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    @if (isPostcard)
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Postcard2.jpg" class="img-fluid" alt="Winter" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                    else
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Greeting2.png" class="img-fluid" alt="Winter" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (designThree)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    @if (isPostcard)
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Postcard3.jpg" class="img-fluid" alt="Puppy" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                    else
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Greeting3.png" class="img-fluid" alt="Puppy" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (designFour)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    @if (isPostcard)
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Postcard4.jpg" class="img-fluid" alt="Beach" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                    else
 | 
			
		||||
                                                                    {
 | 
			
		||||
                                                                        <img style="width:40%;height:40%" src="/img/Greeting4.png" class="img-fluid" alt="Beach" />
 | 
			
		||||
                                                                    }
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (designCustom)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    <h4>We will reach out to discuss your custom design!</h4>
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                    </div>
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            </Template>
 | 
			
		||||
                                        </FormItem>
 | 
			
		||||
                                    </FormItems>
 | 
			
		||||
                                    <FormButtons />
 | 
			
		||||
                                </TelerikForm>
 | 
			
		||||
                            </Content>
 | 
			
		||||
                        </WizardStep>
 | 
			
		||||
                        @*                                                    *@
 | 
			
		||||
                        @* Step 3 - Greeting, verse, signature                *@
 | 
			
		||||
                        @*                                                    *@                        
 | 
			
		||||
                        <WizardStep Label="Customization" OnChange="@OnMessagingStepChange">
 | 
			
		||||
                            <Content>
 | 
			
		||||
                                <TelerikForm Model="@messagingOptions" @ref="@messagingForm">
 | 
			
		||||
                                    <FormItems>
 | 
			
		||||
                                        <FormItem>
 | 
			
		||||
                                            <Template>
 | 
			
		||||
                                                <div class="container">
 | 
			
		||||
                                                    <div class="row">
 | 
			
		||||
                                                        <div class="col-12">
 | 
			
		||||
                                                            <h4 class="mb-3">Please Select a Greeting</h4>
 | 
			
		||||
                                                            <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single" Class="vertical-buttons block-buttons mb-5">
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@greetingOne">Happy Holidays</ButtonGroupToggleButton>
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@greetingTwo">Merry Christmas</ButtonGroupToggleButton>
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@greetingThree">Season's Greetings</ButtonGroupToggleButton>
 | 
			
		||||
                                                            </TelerikButtonGroup>
 | 
			
		||||
                                                            @if (greetingOne)
 | 
			
		||||
                                                            {
 | 
			
		||||
                                                                <div class="p-5">
 | 
			
		||||
                                                                    <img style="width:25%;height:25%" src="/img/greetings/HappyHolidays.png" class="img-fluid" />
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                            else if (greetingTwo)
 | 
			
		||||
                                                            {
 | 
			
		||||
                                                                <div class="p-5">
 | 
			
		||||
                                                                    <img style="width:20%;height:20%" src="/img/greetings/MerryChristmas.png" class="img-fluid" />
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                            else if (greetingThree)
 | 
			
		||||
                                                            {
 | 
			
		||||
                                                                <div class="p-5">
 | 
			
		||||
                                                                    <img style="width:20%;height:20%" src="/img/greetings/SeasonsGreetings.png" class="img-fluid" />
 | 
			
		||||
                                                                </div>
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                            <div class="col-12">
 | 
			
		||||
                                                                <hr />
 | 
			
		||||
                                                                <h4 class="mb-3">Please Select a Verse</h4>
 | 
			
		||||
                                                                <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single" Class="vertical-buttons block-buttons mb-5">
 | 
			
		||||
                                                                    <ButtonGroupToggleButton @bind-Selected="@verseOne">Option 1</ButtonGroupToggleButton>
 | 
			
		||||
                                                                    <ButtonGroupToggleButton @bind-Selected="@verseTwo">Option 2</ButtonGroupToggleButton>
 | 
			
		||||
                                                                    <ButtonGroupToggleButton @bind-Selected="@verseThree">Option 3</ButtonGroupToggleButton>
 | 
			
		||||
                                                                </TelerikButtonGroup>
 | 
			
		||||
                                                                @if (verseOne)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    <p class="fst-italic">We are grateful that you've chosen to do business with us.</p>
 | 
			
		||||
                                                                    <p class="fst-italic">Thank You!</p>
 | 
			
		||||
                                                                    <p class="fst-italic">Wishing you all the best this holiday season and in the New Year.</p>
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (verseTwo)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    <p class="fst-italic">Thank you for putting your trust in us. We wish you a happy and safe holiday season.</p>
 | 
			
		||||
                                                                    <p class="fst-italic">May 2026 bring joy and peace!</p>
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (verseThree)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    <p class="fst-italic">Thank you for trusting your vehicle to us. We appreciate your business.</p>
 | 
			
		||||
                                                                    <p class="fst-italic">Merry Christmas and Happy New Year!</p>
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                            </div>
 | 
			
		||||
                                                            <div class="col-12">
 | 
			
		||||
                                                                <hr class="m-5" />
 | 
			
		||||
                                                                <h4 class="mb-3">Please Select a Signature</h4>
 | 
			
		||||
                                                                <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single" Class="mb-5">
 | 
			
		||||
                                                                    <ButtonGroupToggleButton @bind-Selected="@sigOne">From Your Friends</ButtonGroupToggleButton>
 | 
			
		||||
                                                                    <ButtonGroupToggleButton @bind-Selected="@sigTwo">Name, Title, Phone Number</ButtonGroupToggleButton>
 | 
			
		||||
                                                                    <ButtonGroupToggleButton @bind-Selected="@sigThree">Custom</ButtonGroupToggleButton>
 | 
			
		||||
                                                                </TelerikButtonGroup>
 | 
			
		||||
                                                                @if (sigOne)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    <p>From your friends at <strong>TopSpeed Tire</strong><br /><i>(your location name)</i></p>
 | 
			
		||||
                                                                    <p><strong>(888) 555-3712</strong><br /><i>(your location phone number)</i></p>
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (sigTwo)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    <label style="display:block" for="CustomName" class="k-label k-form-label text-center">Name:</label>
 | 
			
		||||
                                                                    <TelerikTextBox Class="mb-3" Id="CustomName" @bind-Value="@customName" MaxLength="50" Width="25rem"></TelerikTextBox>
 | 
			
		||||
                                                                    <label style="display:block" for="CustomTitle" class="k-label k-form-label text-center">Title:</label>
 | 
			
		||||
                                                                    <TelerikTextBox Class="mb-3" Id="CustomTitle" @bind-Value="@customTitle" MaxLength="50" Width="25rem"></TelerikTextBox>
 | 
			
		||||
                                                                    <label style="display:block" for="CustomPhone" class="k-label k-form-label text-center">Phone:</label>
 | 
			
		||||
                                                                    <TelerikTextBox Class="mb-3" Id="CustomPhone" @bind-Value="@customPhone" MaxLength="15" Width="20rem"></TelerikTextBox>
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                                else if (sigThree)
 | 
			
		||||
                                                                {
 | 
			
		||||
                                                                    <br />
 | 
			
		||||
                                                                    <label style="display:block" for="CustomSignature" class="text-center">Custom Message (max 30 character/line up to 4 lines)</label>
 | 
			
		||||
 | 
			
		||||
                                                                    <br />
 | 
			
		||||
                                                                    <TelerikTextArea Id="CustomSignature" @bind-Value="@customSignature" Rows="4" Cols="35" MaxLength="120"></TelerikTextArea>
 | 
			
		||||
                                                                }
 | 
			
		||||
                                                            </div>                                                        
 | 
			
		||||
                                                        
 | 
			
		||||
                                                    </div>
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            </Template>
 | 
			
		||||
                                        </FormItem>
 | 
			
		||||
                                    </FormItems>
 | 
			
		||||
                                    <FormButtons />
 | 
			
		||||
                                </TelerikForm>
 | 
			
		||||
                            </Content>
 | 
			
		||||
                        </WizardStep>
 | 
			
		||||
                        @*                                                 *@
 | 
			
		||||
                        @* Step 4 - Logo Selection *@
 | 
			
		||||
                        @*                                                 *@
 | 
			
		||||
                        <WizardStep Label="Logos" OnChange="@OnLogoStepChange">
 | 
			
		||||
                            <Content>
 | 
			
		||||
                                <TelerikForm Model="@logoOptions" @ref="@logoForm">
 | 
			
		||||
                                    <FormItems>
 | 
			
		||||
                                        <FormItem>
 | 
			
		||||
                                            <Template>
 | 
			
		||||
                                                <div class="container">
 | 
			
		||||
                                                    <div class="col-12 text-center mb-3">
 | 
			
		||||
                                                        <h4 class="mb-3">Would you like to include your logo on the card?</h4>
 | 
			
		||||
                                                        <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single" Class="vertical-buttons block-buttons mb-5">
 | 
			
		||||
                                                            <ButtonGroupToggleButton @bind-Selected="@logoOnCard">Yes</ButtonGroupToggleButton>
 | 
			
		||||
                                                            <ButtonGroupToggleButton>No</ButtonGroupToggleButton>
 | 
			
		||||
                                                        </TelerikButtonGroup>
 | 
			
		||||
                                                        @if (isGreetingCard)
 | 
			
		||||
                                                        {
 | 
			
		||||
                                                            <hr class="m-5" />
 | 
			
		||||
                                                            <h4 class="mb-3">Would you like to include your logo on the envelope?</h4>
 | 
			
		||||
                                                            <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single" Class="vertical-buttons block-buttons mb-5">
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@logoOnEnvelope">Yes</ButtonGroupToggleButton>
 | 
			
		||||
                                                                <ButtonGroupToggleButton>No</ButtonGroupToggleButton>
 | 
			
		||||
                                                            </TelerikButtonGroup>
 | 
			
		||||
                                                        }
 | 
			
		||||
                                                    </div>
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            </Template>
 | 
			
		||||
                                        </FormItem>
 | 
			
		||||
                                    </FormItems>
 | 
			
		||||
                                    <FormButtons>
 | 
			
		||||
                                    </FormButtons>
 | 
			
		||||
                                </TelerikForm>
 | 
			
		||||
                            </Content>
 | 
			
		||||
                        </WizardStep>                       
 | 
			
		||||
                        @*                                                                                    *@
 | 
			
		||||
                        @* Step 5 - Location information *@
 | 
			
		||||
                        @*                                                                                    *@
 | 
			
		||||
                        <WizardStep Label="Location Info" OnChange="@OnLocationStepChange" Valid="@isLocationInfoValid">
 | 
			
		||||
                            <Content>
 | 
			
		||||
                                <div class="container">
 | 
			
		||||
                                    <div class="row">
 | 
			
		||||
                                        <div class="col-12">
 | 
			
		||||
                                            <TelerikForm Model="@locationInfo" @ref="@locationForm" Columns="2" ColumnSpacing="25px">
 | 
			
		||||
                                                <FormButtons />
 | 
			
		||||
                                            </TelerikForm>
 | 
			
		||||
                                        </div>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </Content>
 | 
			
		||||
                        </WizardStep>
 | 
			
		||||
                        @*                                                 *@
 | 
			
		||||
                        @* Step 6 - Payment                                *@
 | 
			
		||||
                        @*                                                 *@
 | 
			
		||||
                        <WizardStep Label="Payment Info">
 | 
			
		||||
                            <Content>
 | 
			
		||||
                                <TelerikForm Model="@paymentInfo" @ref="@paymentForm">
 | 
			
		||||
                                    <FormItems>
 | 
			
		||||
                                        <FormItem>
 | 
			
		||||
                                            <Template>
 | 
			
		||||
                                                <div class="container">
 | 
			
		||||
                                                    <div class="row">
 | 
			
		||||
                                                        <div class="col-12">
 | 
			
		||||
                                                            <TelerikButtonGroup SelectionMode="@ButtonGroupSelectionMode.Single" Class="vertical-buttons block-buttons mb-5">
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@ccOnFile">Credit Card On File</ButtonGroupToggleButton>
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@callWithInfo">Call With Payment Info</ButtonGroupToggleButton>
 | 
			
		||||
                                                                <ButtonGroupToggleButton @bind-Selected="@check">Check</ButtonGroupToggleButton>
 | 
			
		||||
                                                            </TelerikButtonGroup>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                        <div class="col-12 mb-5">
 | 
			
		||||
                                                            @if (ccOnFile)
 | 
			
		||||
                                                            {
 | 
			
		||||
                                                                <h4>Use our preferred payment method already on file.</h4>
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                            else if (callWithInfo)
 | 
			
		||||
                                                            {
 | 
			
		||||
                                                                <h4>Please call me.</h4>
 | 
			
		||||
                                                                <p>I'll specify method of payment when reviewing the order.</p>
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                            else if (check)
 | 
			
		||||
                                                            {
 | 
			
		||||
                                                                <h4>I'll be sending in a check</h4>
 | 
			
		||||
                                                                <p>I'll be sending in a check by the invoice's due date (10/24/2025).</p>
 | 
			
		||||
                                                            }
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                        <hr />
 | 
			
		||||
                                                        <div class="col-12">
 | 
			
		||||
                                                            <label style="display:block" for="RequestedQuantity" class="text-center mb-3">Requested Quantity</label>
 | 
			
		||||
                                                            <TelerikTextBox class="mb-3" Id="RequestedQuantity" @bind-Value="@requestedQuantity" MaxLength="6" Width="15rem"></TelerikTextBox>
 | 
			
		||||
                                                            <label style="display:block" for="AdditionalComments" class="text-center mb-3">Additional Notes</label>
 | 
			
		||||
                                                            <TelerikTextArea class="mb-3" Id="CustomSignature" @bind-Value="@additionalComments" Rows="8" Cols="100" MaxLength="2500"></TelerikTextArea>
 | 
			
		||||
                                                        </div>
 | 
			
		||||
                                                    </div>
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            </Template>
 | 
			
		||||
                                        </FormItem>
 | 
			
		||||
                                    </FormItems>
 | 
			
		||||
                                    <FormButtons />
 | 
			
		||||
                                </TelerikForm>
 | 
			
		||||
                            </Content>
 | 
			
		||||
                        </WizardStep>
 | 
			
		||||
                    </WizardSteps>
 | 
			
		||||
                </TelerikWizard>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
}
 | 
			
		||||
else
 | 
			
		||||
{
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            <div class="col-12 m-5">
 | 
			
		||||
                Thank you, our customer care team will be in touch with you soon!
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-12">
 | 
			
		||||
                <RandomImage />
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@* @if (appState != null)
 | 
			
		||||
{
 | 
			
		||||
    <pre style="font-size:.8em">
 | 
			
		||||
        SessionId: @appState.SessionId
 | 
			
		||||
        DateCreated: @appState.DateCreated
 | 
			
		||||
        DateExpires: @appState.DateExpires
 | 
			
		||||
        IPAddress: @appState.myIpAddress
 | 
			
		||||
        IPAddress2: @(IpAddressService.RemoteIpAddress.ToString())
 | 
			
		||||
    </pre>
 | 
			
		||||
}
 | 
			
		||||
 *@
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,386 @@
 | 
			
		|||
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 WinterBestCustomerWebForm.AppState;
 | 
			
		||||
using WinterBestCustomerWebForm.ClassObj;
 | 
			
		||||
 | 
			
		||||
namespace WinterBestCustomerWebForm.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" : "Greeting Card";
 | 
			
		||||
            var cardDesign = string.Empty;
 | 
			
		||||
            if (designOne)
 | 
			
		||||
                cardDesign = isGreetingCard ? "A" : "E";
 | 
			
		||||
            else if (designTwo)
 | 
			
		||||
                cardDesign = isGreetingCard ? "B" : "F";
 | 
			
		||||
            else if (designThree)
 | 
			
		||||
                cardDesign = isGreetingCard ? "C" : "G";
 | 
			
		||||
            else if (designFour)
 | 
			
		||||
                cardDesign = isGreetingCard ? "D" : "H";
 | 
			
		||||
            else if (designCustom)
 | 
			
		||||
                cardDesign = "CUSTOM";
 | 
			
		||||
            // Customizations
 | 
			
		||||
            var greetingChoice = string.Empty;
 | 
			
		||||
            var verseChoice = string.Empty;
 | 
			
		||||
            var sigChoice = string.Empty;
 | 
			
		||||
 | 
			
		||||
            if (greetingOne)
 | 
			
		||||
                greetingChoice = "Happy Holidays";
 | 
			
		||||
            else if (greetingTwo)
 | 
			
		||||
                greetingChoice = "Merry Christmas";
 | 
			
		||||
            else if (greetingThree)
 | 
			
		||||
                greetingChoice = "Season's Greetings";
 | 
			
		||||
 | 
			
		||||
            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:<br />{0}<br />{1}", locationInfo.LocationName, locationInfo.PhoneNumber);
 | 
			
		||||
            else if (sigTwo)
 | 
			
		||||
                sigChoice = string.Format("Option E - Name: {0}<br />Title: {1}<br />Phone: {2}", customName, customTitle, customPhone);
 | 
			
		||||
            else if (sigThree)
 | 
			
		||||
                sigChoice = string.Format("Option F - {0}", customSignature);
 | 
			
		||||
 | 
			
		||||
            // combine these into customizationInfo
 | 
			
		||||
            var customizationInfo = string.Format("<tr><td>Greeting:</td><td>{0}</td></tr><tr><td>Verse:</td><td>{1}</td></tr><tr><td>Signature:</td><td>{2}</td></tr>", greetingChoice, verseChoice, sigChoice);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            // Logo info
 | 
			
		||||
            var logos = new List<string>();
 | 
			
		||||
            if (logoOnCard)
 | 
			
		||||
                logos.Add("Logo on Card");
 | 
			
		||||
            if (isGreetingCard && logoOnEnvelope)
 | 
			
		||||
                logos.Add("Logo on Envelope");
 | 
			
		||||
            if (logos.Count == 0)
 | 
			
		||||
                logos.Add("NONE");
 | 
			
		||||
 | 
			
		||||
            // Payment info
 | 
			
		||||
            string paymentMethod = string.Empty;
 | 
			
		||||
            if (ccOnFile)
 | 
			
		||||
                paymentMethod = "Credit Card on File";
 | 
			
		||||
            else if (callWithInfo)
 | 
			
		||||
                paymentMethod = "Call With Payment Info";
 | 
			
		||||
            else if (check)
 | 
			
		||||
                paymentMethod = "Check";
 | 
			
		||||
 | 
			
		||||
            // Formulating the email to send
 | 
			
		||||
            em.Subject = "WBC Order Form Submission";
 | 
			
		||||
            em.AddAddress(enuAddressType.From, "support@keymotive.us", "Winter Program Enrollment");
 | 
			
		||||
            //em.AddAddress(enuAddressType.To, "support@keymotive.net", "KeyMotive Support");
 | 
			
		||||
            //em.AddAddress(enuAddressType.To, "jondeck@keymotive.net", "Jon Deck");
 | 
			
		||||
            //em.AddAddress(enuAddressType.To, "amijat@keymotive.net", "Andrea Mijat");
 | 
			
		||||
            em.AddAddress(enuAddressType.To, "joshdeck@keymotive.net", "Josh Deck");
 | 
			
		||||
 | 
			
		||||
            var locInfoString = string.Format("<tr style='padding-top:14px'><td>Location Name:</td><td>{0}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>Manager:</td><td>{1}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>Address:</td><td>{2}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>City:</td><td>{3}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>State:</td><td>{4}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>Zip:</td><td>{5}</td></tr>" +
 | 
			
		||||
                                            "<tr style='padding-top:14px'><td>Phone Number:</td><td>{6}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>Contact Name:</td><td>{7}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>Contact Phone:</td><td>{8}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>Contact Email:</td><td>{9}</td></tr>",
 | 
			
		||||
                    locationInfo.LocationName, locationInfo.Manager, locationInfo.Address, locationInfo.City, locationInfo.State,
 | 
			
		||||
                    locationInfo.Zip, locationInfo.PhoneNumber, locationInfo.ContactName,
 | 
			
		||||
                    locationInfo.ContactPhone, locationInfo.ContactEmail);
 | 
			
		||||
 | 
			
		||||
            var cardInfoString = string.Format("<tr><td>Card type:</td><td>{0}, Design {1}</td></tr>" +
 | 
			
		||||
                                            "<tr style='padding-top:14px'><td colspan='2'>Customization Options:</td></tr>" +
 | 
			
		||||
                                            "{2}" +
 | 
			
		||||
                                            "<tr><td>Logos:</td><td>{3}</td></tr>",
 | 
			
		||||
                                                                                    cardType, cardDesign, customizationInfo, string.Join(", ", logos));
 | 
			
		||||
 | 
			
		||||
            if (int.TryParse(requestedQuantity, out _))
 | 
			
		||||
                requestedQuantity = string.Format("{0:#,##0}", int.Parse(requestedQuantity));
 | 
			
		||||
 | 
			
		||||
            var paymentString = string.Format("<tr><td>Payment Method:</td><td>{0}</td></tr>" +
 | 
			
		||||
                                            "<tr style='padding-top:14px'><td>Requested Quantity:</td><td>{1}</td></tr>" +
 | 
			
		||||
                                            "<tr><td>Additional Comments:</td><td>{2}</td></tr>", paymentMethod, requestedQuantity, additionalComments);
 | 
			
		||||
            var ipString = string.Format("<tr style='padding-top:20px'><td>IP Address</td><td>{0}</td></tr>",
 | 
			
		||||
                string.IsNullOrWhiteSpace(IpAddressService.RemoteIpAddress.ToString()) ? "NONE" : IpAddressService.RemoteIpAddress.ToString());
 | 
			
		||||
 | 
			
		||||
            em.HtmlBody = "<div style='font-size:1.05em'><b>You have a new enrollment:</b><br /><br /><table style='font-size:1.05em;display:block;font-family: monospace;'>" +
 | 
			
		||||
                locInfoString + cardInfoString + paymentString + ipString + "</table></div>";
 | 
			
		||||
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                em.Send();
 | 
			
		||||
                await Console.Out.WriteLineAsync("Done sending");
 | 
			
		||||
            }
 | 
			
		||||
            catch (Exception e)
 | 
			
		||||
            {
 | 
			
		||||
                await Console.Out.WriteLineAsync("ERROR: " + e.Message);
 | 
			
		||||
            }
 | 
			
		||||
            ShowWizard = false;
 | 
			
		||||
            await Dialogs.AlertAsync("The Registration was submitted successfully", "Done");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #region "User Selections - Model"
 | 
			
		||||
 | 
			
		||||
    public bool? IsAudienceChoiceValid { get; set; } = true;
 | 
			
		||||
    public bool? IsCardChoiceValid { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
    public bool? IsDesignChoiceValid { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
    [CascadingParameter]
 | 
			
		||||
    public DialogFactory Dialogs { get; set; } = default!;
 | 
			
		||||
 | 
			
		||||
    public bool ProgramClosed { get; set; } = false;
 | 
			
		||||
    public bool ShowWizard { get; set; } = true;
 | 
			
		||||
 | 
			
		||||
    public int Value { get; set; } = 0;
 | 
			
		||||
 | 
			
		||||
    //public TelerikForm RegisterForm { get; set; }
 | 
			
		||||
    public User UserModel { get; set; } = new User();
 | 
			
		||||
 | 
			
		||||
    public TelerikForm IntroForm { get; set; } = new();
 | 
			
		||||
 | 
			
		||||
    // Variables for selecting between plastic and post
 | 
			
		||||
    public TelerikForm cardTypeForm { get; set; } = new();
 | 
			
		||||
    public CardType cardType { get; set; } = new CardType();
 | 
			
		||||
    public bool isGreetingCard { get; set; } = true;
 | 
			
		||||
    public bool isPostcard { get; set; } = false;
 | 
			
		||||
    public string audienceType { get; set; } = string.Empty;
 | 
			
		||||
    public List<AudienceType> audiences { get; set; } = new List<AudienceType>
 | 
			
		||||
    {
 | 
			
		||||
        new AudienceType() {AudienceDescription="Send to my BEST CUSTOMERS"},
 | 
			
		||||
        new AudienceType() {AudienceDescription="Send to Great Prospects as well as Customers who haven't been in during the past 8 months"}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    // Variables for selecting specific design
 | 
			
		||||
    public TelerikForm customizationForm { get; set; } = new();
 | 
			
		||||
    public CustomizationOptions custOptions { get; set; } = new CustomizationOptions();
 | 
			
		||||
    public bool designOne = true;
 | 
			
		||||
    public bool designTwo = false;
 | 
			
		||||
    public bool designThree = false;
 | 
			
		||||
    public bool designFour = false;
 | 
			
		||||
    public bool designCustom = false;
 | 
			
		||||
 | 
			
		||||
    // Variables for selecting messaging (postcards only)
 | 
			
		||||
    public TelerikForm messagingForm { get; set; } = new();
 | 
			
		||||
    public MessagingOptions messagingOptions { get; set; } = new MessagingOptions();
 | 
			
		||||
    public bool greetingOne = true;
 | 
			
		||||
    public bool greetingTwo = false;
 | 
			
		||||
    public bool greetingThree = false;
 | 
			
		||||
    public bool verseOne = true;
 | 
			
		||||
    public bool verseTwo = false;
 | 
			
		||||
    public bool verseThree = false;
 | 
			
		||||
    public bool sigOne = true;
 | 
			
		||||
    public bool sigTwo = false;
 | 
			
		||||
    public bool sigThree = false;
 | 
			
		||||
    public string customName = string.Empty; // For sig two
 | 
			
		||||
    public string customTitle = string.Empty;
 | 
			
		||||
    public string customPhone = string.Empty;
 | 
			
		||||
    public string customSignature = string.Empty; // For sig three
 | 
			
		||||
    public bool isMessagingValid = false;
 | 
			
		||||
 | 
			
		||||
    // Variables for logo selection
 | 
			
		||||
    public TelerikForm logoForm { get; set; } = new();
 | 
			
		||||
    public LogoOptions logoOptions { get; set; } = new LogoOptions();
 | 
			
		||||
    public bool logoOnCard = true;
 | 
			
		||||
    public bool logoOnEnvelope = true;
 | 
			
		||||
    public bool isLogoValid = true;
 | 
			
		||||
 | 
			
		||||
    // Variables for offer selection (plastic cards only)
 | 
			
		||||
    public TelerikForm offerForm { get; set; } = new();
 | 
			
		||||
    public OfferOptions offerOptions { get; set; } = new OfferOptions();
 | 
			
		||||
    public bool[] bigOffers = new bool[6];
 | 
			
		||||
    public bool[] smallOffers = new bool[12];
 | 
			
		||||
    public bool isOfferSelectionValid = false;
 | 
			
		||||
 | 
			
		||||
    // Location information
 | 
			
		||||
    public TelerikForm locationForm { get; set; } = new();
 | 
			
		||||
    public LocationInfo locationInfo { get; set; } = new LocationInfo();
 | 
			
		||||
    public string locationName { get; set; } = string.Empty;
 | 
			
		||||
    public string manager { get; set; } = string.Empty;
 | 
			
		||||
    public string address { get; set; } = string.Empty;
 | 
			
		||||
    public string city { get; set; } = string.Empty;
 | 
			
		||||
    public string state { get; set; } = string.Empty;
 | 
			
		||||
    public string zip { get; set; } = string.Empty;
 | 
			
		||||
    public string phoneNumber { get; set; } = string.Empty;
 | 
			
		||||
    public string contactName { get; set; } = string.Empty;
 | 
			
		||||
    public string contactPhone { get; set; } = string.Empty;
 | 
			
		||||
    public string contactEmail { get; set; } = string.Empty;
 | 
			
		||||
    public bool isLocationInfoValid { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
    // Payment information
 | 
			
		||||
    public TelerikForm paymentForm { get; set; } = new();
 | 
			
		||||
    public PaymentInfo paymentInfo { get; set; } = new PaymentInfo();
 | 
			
		||||
    public string requestedQuantity = string.Empty;
 | 
			
		||||
    public string additionalComments = string.Empty;
 | 
			
		||||
    public bool ccOnFile = true;
 | 
			
		||||
    public bool callWithInfo = false;
 | 
			
		||||
    public bool check = false;
 | 
			
		||||
 | 
			
		||||
    #endregion
 | 
			
		||||
 | 
			
		||||
    public void ToggleCardType()
 | 
			
		||||
    {
 | 
			
		||||
        isGreetingCard = !isGreetingCard;
 | 
			
		||||
        isPostcard = !isPostcard;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void OnCardChoiceStepChange(WizardStepChangeEventArgs args)
 | 
			
		||||
    {
 | 
			
		||||
        IsCardChoiceValid = true; // This is forced to be true but required nonetheless
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void OnDesignStepChange(WizardStepChangeEventArgs args)
 | 
			
		||||
    {
 | 
			
		||||
        IsDesignChoiceValid = true; // Same as card choice
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void OnMessagingStepChange(WizardStepChangeEventArgs args)
 | 
			
		||||
    {
 | 
			
		||||
        isMessagingValid = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void OnLogoStepChange(WizardStepChangeEventArgs arg)
 | 
			
		||||
    {
 | 
			
		||||
        isLogoValid = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public async void OnOfferStepChange(WizardStepChangeEventArgs args)
 | 
			
		||||
    {
 | 
			
		||||
        if (isPostcard)
 | 
			
		||||
        {
 | 
			
		||||
            isOfferSelectionValid = true;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            int bigOfferCount = 0;
 | 
			
		||||
            foreach (bool selection in bigOffers)
 | 
			
		||||
            {
 | 
			
		||||
                if (selection)
 | 
			
		||||
                    bigOfferCount++;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            int smallOfferCount = 0;
 | 
			
		||||
            foreach (bool selection in smallOffers)
 | 
			
		||||
            {
 | 
			
		||||
                if (selection)
 | 
			
		||||
                    smallOfferCount++;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (smallOfferCount == 4 && bigOfferCount == 2)
 | 
			
		||||
                isOfferSelectionValid = true;
 | 
			
		||||
            else
 | 
			
		||||
                isOfferSelectionValid = false;
 | 
			
		||||
 | 
			
		||||
            if (!isOfferSelectionValid)
 | 
			
		||||
            {
 | 
			
		||||
                args.IsCancelled = true;
 | 
			
		||||
                await Dialogs.AlertAsync("Please select the proper amount of offers.", "You cannot proceed");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public async void OnLocationStepChange(WizardStepChangeEventArgs args)
 | 
			
		||||
    {
 | 
			
		||||
        isLocationInfoValid = !string.IsNullOrWhiteSpace(locationInfo.ContactEmail) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.ContactPhone) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.ContactName) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.City) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.State) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.Zip) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.PhoneNumber) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.LocationName) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.Address) &&
 | 
			
		||||
                                !string.IsNullOrWhiteSpace(locationInfo.Manager);
 | 
			
		||||
 | 
			
		||||
        if (!isLocationInfoValid)
 | 
			
		||||
        {
 | 
			
		||||
            args.IsCancelled = true;
 | 
			
		||||
            await Dialogs.AlertAsync("Please fill out all required fields.", "You cannot proceed");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #region "Models and Such"
 | 
			
		||||
 | 
			
		||||
    public class CardType
 | 
			
		||||
    {
 | 
			
		||||
        [Required]
 | 
			
		||||
        public string cardChoice { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class CustomizationOptions
 | 
			
		||||
    {
 | 
			
		||||
        [Required]
 | 
			
		||||
        public string custOption { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class MessagingOptions
 | 
			
		||||
    {
 | 
			
		||||
        public string verse { get; set; } = string.Empty;
 | 
			
		||||
        public string signature { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class LogoOptions
 | 
			
		||||
    {
 | 
			
		||||
        public string option { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class OfferOptions
 | 
			
		||||
    {
 | 
			
		||||
        public string option { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class LocationInfo
 | 
			
		||||
    {
 | 
			
		||||
        [Required, Display(Name = "Location Name")]
 | 
			
		||||
        public string LocationName { get; set; } = string.Empty;
 | 
			
		||||
        [Required, Display(Name = "Store Manager")]
 | 
			
		||||
        public string Manager { get; set; } = string.Empty;
 | 
			
		||||
        [Required]
 | 
			
		||||
        public string Address { get; set; } = string.Empty;
 | 
			
		||||
        [Required]
 | 
			
		||||
        public string City { get; set; } = string.Empty;
 | 
			
		||||
        [Required]
 | 
			
		||||
        public string State { get; set; } = string.Empty;
 | 
			
		||||
        [Required]
 | 
			
		||||
        public string Zip { get; set; } = string.Empty;
 | 
			
		||||
        [Required, Display(Name = "Phone Number")]
 | 
			
		||||
        public string PhoneNumber { get; set; } = string.Empty;
 | 
			
		||||
        [Required, Display(Name = "Contact Name")]
 | 
			
		||||
        public string ContactName { get; set; } = string.Empty;
 | 
			
		||||
        [Required, Display(Name = "Contact Phone")]
 | 
			
		||||
        public string ContactPhone { get; set; } = string.Empty;
 | 
			
		||||
        [Required, Display(Name = "Your Email Address")]
 | 
			
		||||
        public string ContactEmail { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class PaymentInfo
 | 
			
		||||
    {
 | 
			
		||||
        public string info { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class AudienceType
 | 
			
		||||
    {
 | 
			
		||||
        public string AudienceDescription { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
    #endregion
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
.scrollable-stepper {
 | 
			
		||||
    border: 1px solid red;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    .scrollable-stepper .k-stepper {
 | 
			
		||||
        overflow-y: hidden;
 | 
			
		||||
        overflow-x: auto;
 | 
			
		||||
        padding-bottom: 1em;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        .scrollable-stepper .k-stepper .k-step-list-horizontal {
 | 
			
		||||
            width: 1600px;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .scrollable-stepper .k-stepper .k-progressbar {
 | 
			
		||||
            width: 1520px; /*(step list width - 1 step width)*/
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
<img alt="" class="img-fluid" src="@ImagePath" />
 | 
			
		||||
@code {
 | 
			
		||||
    public string ImagePath { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
    protected override Task OnInitializedAsync()//(bool firstRender)
 | 
			
		||||
    {
 | 
			
		||||
        //if (firstRender)
 | 
			
		||||
        {
 | 
			
		||||
            string[] images = new[] { "d304641b-bfef-4d2f-a715-67184d59b171.jpg", "3db66a22-7e36-4b4a-8d85-3aa27e1c8220.jpg" };
 | 
			
		||||
            int ix = Random.Shared.Next(0, images.Length);
 | 
			
		||||
 | 
			
		||||
            ImagePath = string.Format("/img/{0}", images[ix]);
 | 
			
		||||
        }
 | 
			
		||||
        return base.OnInitializedAsync();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
<!-- Wrap the router in a cascading app state -->
 | 
			
		||||
<IPAddressGrabber />
 | 
			
		||||
<CascadingAppState>
 | 
			
		||||
    <Router AppAssembly="typeof(Program).Assembly">
 | 
			
		||||
        <Found Context="routeData">
 | 
			
		||||
            <RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
 | 
			
		||||
            <FocusOnNavigate RouteData="routeData" Selector="h1" />
 | 
			
		||||
        </Found>
 | 
			
		||||
    </Router>
 | 
			
		||||
</CascadingAppState>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
@using System.Net.Http
 | 
			
		||||
@using System.Net.Http.Json
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Forms
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Routing
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Web
 | 
			
		||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
 | 
			
		||||
@using Microsoft.JSInterop
 | 
			
		||||
@using WinterBestCustomerWebForm
 | 
			
		||||
@using WinterBestCustomerWebForm.Components
 | 
			
		||||
@using WinterBestCustomerWebForm.AppState
 | 
			
		||||
@using Telerik.Blazor
 | 
			
		||||
@using Telerik.Blazor.Components
 | 
			
		||||
@using Telerik.SvgIcons
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,67 @@
 | 
			
		|||
using Microsoft.AspNetCore.ResponseCompression;
 | 
			
		||||
using WinterBestCustomerWebForm.ClassObj;
 | 
			
		||||
using WinterBestCustomerWebForm.Components;
 | 
			
		||||
using System.IO.Compression;
 | 
			
		||||
 | 
			
		||||
namespace WinterBestCustomerWebForm
 | 
			
		||||
{
 | 
			
		||||
    public class Program
 | 
			
		||||
    {
 | 
			
		||||
        public static void Main(string[] args)
 | 
			
		||||
        {
 | 
			
		||||
            var builder = WebApplication.CreateBuilder(args);
 | 
			
		||||
 | 
			
		||||
            // Add services to the container.
 | 
			
		||||
            builder.Services.AddRazorComponents()
 | 
			
		||||
                    .AddInteractiveServerComponents();
 | 
			
		||||
 | 
			
		||||
            builder.Services.AddResponseCompression(options =>
 | 
			
		||||
            {
 | 
			
		||||
                options.EnableForHttps = true;
 | 
			
		||||
                options.Providers.Add<BrotliCompressionProvider>();
 | 
			
		||||
                options.Providers.Add<GzipCompressionProvider>();
 | 
			
		||||
            });
 | 
			
		||||
            builder.Services.Configure<BrotliCompressionProviderOptions>(options =>
 | 
			
		||||
            {
 | 
			
		||||
                options.Level = CompressionLevel.Fastest;
 | 
			
		||||
            });
 | 
			
		||||
            builder.Services.Configure<GzipCompressionProviderOptions>(options =>
 | 
			
		||||
            {
 | 
			
		||||
                options.Level = CompressionLevel.SmallestSize;
 | 
			
		||||
            });
 | 
			
		||||
            builder.Services.AddDataProtection();
 | 
			
		||||
 | 
			
		||||
            builder.Services.AddHttpContextAccessor();
 | 
			
		||||
            builder.Services.AddScoped<HttpContextAccessor>();
 | 
			
		||||
            builder.Services.AddScoped<IPAddressService>();             // IPADDR
 | 
			
		||||
 | 
			
		||||
            var app = builder.Build();
 | 
			
		||||
 | 
			
		||||
            // Configure the HTTP request pipeline.
 | 
			
		||||
            if (!app.Environment.IsDevelopment())
 | 
			
		||||
            {
 | 
			
		||||
                app.UseExceptionHandler("/Error");
 | 
			
		||||
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
 | 
			
		||||
                app.UseHsts();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var webSocketOptions = new WebSocketOptions()
 | 
			
		||||
            {
 | 
			
		||||
                KeepAliveInterval = TimeSpan.FromSeconds(15)
 | 
			
		||||
            };
 | 
			
		||||
            app.UseWebSockets(webSocketOptions);
 | 
			
		||||
            app.UseResponseCompression();
 | 
			
		||||
            app.UseResponseCaching();
 | 
			
		||||
 | 
			
		||||
            app.UseHttpsRedirection();
 | 
			
		||||
 | 
			
		||||
            app.UseStaticFiles();
 | 
			
		||||
            app.UseAntiforgery();
 | 
			
		||||
 | 
			
		||||
            app.MapRazorComponents<App>()
 | 
			
		||||
                    .AddInteractiveServerRenderMode();
 | 
			
		||||
 | 
			
		||||
            app.Run();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,38 @@
 | 
			
		|||
{
 | 
			
		||||
    "$schema": "http://json.schemastore.org/launchsettings.json",
 | 
			
		||||
        "iisSettings": {
 | 
			
		||||
            "windowsAuthentication": false,
 | 
			
		||||
            "anonymousAuthentication": true,
 | 
			
		||||
            "iisExpress": {
 | 
			
		||||
                "applicationUrl": "http://localhost:62562",
 | 
			
		||||
                "sslPort": 44306
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        "profiles": {
 | 
			
		||||
            "http": {
 | 
			
		||||
                "commandName": "Project",
 | 
			
		||||
                "dotnetRunMessages": true,
 | 
			
		||||
                "launchBrowser": true,
 | 
			
		||||
                "applicationUrl": "http://localhost:5052",
 | 
			
		||||
                "environmentVariables": {
 | 
			
		||||
                    "ASPNETCORE_ENVIRONMENT": "Development"
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            "https": {
 | 
			
		||||
                "commandName": "Project",
 | 
			
		||||
                "dotnetRunMessages": true,
 | 
			
		||||
                "launchBrowser": true,
 | 
			
		||||
                "applicationUrl": "https://localhost:7078;http://localhost:5052",
 | 
			
		||||
                "environmentVariables": {
 | 
			
		||||
                    "ASPNETCORE_ENVIRONMENT": "Development"
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            "IIS Express": {
 | 
			
		||||
                "commandName": "IISExpress",
 | 
			
		||||
                "launchBrowser": true,
 | 
			
		||||
                "environmentVariables": {
 | 
			
		||||
                    "ASPNETCORE_ENVIRONMENT": "Development"
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
namespace WinterBestCustomerWebForm.SessionState;
 | 
			
		||||
 | 
			
		||||
public class MdlSession : Dictionary<string, string>
 | 
			
		||||
{
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// Gets or sets the Session Id value.
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public string SessionId { get; set; } = string.Empty;
 | 
			
		||||
    public string IPAddress { get; set; } = string.Empty;
 | 
			
		||||
    public bool IsCheckedOut { get; set; } = false;
 | 
			
		||||
    public DateTimeOffset dtExpires { get; set; } = DateTimeOffset.Now.AddHours(36);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,57 @@
 | 
			
		|||
namespace WinterBestCustomerWebForm.SessionState;
 | 
			
		||||
 | 
			
		||||
// INTERFACE
 | 
			
		||||
 | 
			
		||||
public interface ISessionIdManager
 | 
			
		||||
{
 | 
			
		||||
    Task<string?> GetSessionIdAsync();
 | 
			
		||||
    Task<string?> GetIPAddressAsync();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CODE
 | 
			
		||||
 | 
			
		||||
public class SessionIdManager(IHttpContextAccessor httpContextAccessor) : ISessionIdManager
 | 
			
		||||
{
 | 
			
		||||
    private readonly IHttpContextAccessor HttpContextAccessor = httpContextAccessor;
 | 
			
		||||
 | 
			
		||||
    public Task<string?> GetSessionIdAsync()
 | 
			
		||||
    {
 | 
			
		||||
        var httpContext = HttpContextAccessor.HttpContext;
 | 
			
		||||
        string? result;
 | 
			
		||||
 | 
			
		||||
        if (httpContext != null)
 | 
			
		||||
        {
 | 
			
		||||
            if (httpContext.Request.Cookies.ContainsKey("sessionId"))
 | 
			
		||||
            {
 | 
			
		||||
                result = httpContext.Request.Cookies["sessionId"];
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                result = Guid.NewGuid().ToString();
 | 
			
		||||
                httpContext.Response.Cookies.Append("sessionId", result);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            throw new InvalidOperationException("No HttpContext available");
 | 
			
		||||
        }
 | 
			
		||||
        return Task.FromResult(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Task<string?> GetIPAddressAsync()
 | 
			
		||||
    {
 | 
			
		||||
        var httpContext = HttpContextAccessor.HttpContext;
 | 
			
		||||
        string? result;
 | 
			
		||||
 | 
			
		||||
        if (httpContext != null)
 | 
			
		||||
        {
 | 
			
		||||
            result = httpContext.Connection.RemoteIpAddress?.ToString();// ?? "Not Set";
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            throw new InvalidOperationException("No HttpContext available");
 | 
			
		||||
        }
 | 
			
		||||
        return Task.FromResult(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,132 @@
 | 
			
		|||
using System.Net;
 | 
			
		||||
 | 
			
		||||
namespace WinterBestCustomerWebForm.SessionState;
 | 
			
		||||
 | 
			
		||||
// INTERFACE
 | 
			
		||||
 | 
			
		||||
public interface ISessionManager
 | 
			
		||||
{
 | 
			
		||||
    Task<MdlSession> GetSession();
 | 
			
		||||
    Task UpdateSession(MdlSession session);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CODE
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// Dictionary containing per-user session objects, keyed
 | 
			
		||||
/// by sessionId.
 | 
			
		||||
/// </summary>
 | 
			
		||||
public class SessionManager : ISessionManager
 | 
			
		||||
{
 | 
			
		||||
    private Dictionary<Guid, MdlSession> _sessions = new Dictionary<Guid, MdlSession>();
 | 
			
		||||
    private readonly ISessionIdManager _sessionIdManager;
 | 
			
		||||
    private object syncLock1 = new();
 | 
			
		||||
 | 
			
		||||
    public SessionManager(ISessionIdManager sessionIdManager)
 | 
			
		||||
    {
 | 
			
		||||
        _sessionIdManager = sessionIdManager;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public async Task<MdlSession> GetSession()
 | 
			
		||||
    {
 | 
			
		||||
        string key = await _sessionIdManager.GetSessionIdAsync() ?? "";
 | 
			
		||||
        string ipAddress = await _sessionIdManager.GetIPAddressAsync() ?? "";
 | 
			
		||||
        Guid theSessionId;
 | 
			
		||||
 | 
			
		||||
        if (!Guid.TryParse(key, out theSessionId))
 | 
			
		||||
            theSessionId = Guid.Empty;//Guid.Parse(key);
 | 
			
		||||
 | 
			
		||||
        MdlSession session;
 | 
			
		||||
        bool needToCreateNew = false;
 | 
			
		||||
 | 
			
		||||
        if (!_sessions.ContainsKey(theSessionId))
 | 
			
		||||
        {
 | 
			
		||||
            needToCreateNew = true;
 | 
			
		||||
        }
 | 
			
		||||
        else if (_sessions[theSessionId].dtExpires < DateTimeOffset.Now)
 | 
			
		||||
            needToCreateNew = true;
 | 
			
		||||
 | 
			
		||||
        if (needToCreateNew)
 | 
			
		||||
        {
 | 
			
		||||
            session = new MdlSession() { SessionId = key, IPAddress = ipAddress };
 | 
			
		||||
            _sessions.Add(theSessionId, new MdlSession());
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
            session = _sessions[theSessionId];
 | 
			
		||||
 | 
			
		||||
        // ensure session isn't checked out by wasm
 | 
			
		||||
        //while (session.IsCheckedOut)
 | 
			
		||||
        //        await Task.Delay(5);
 | 
			
		||||
        var endTime = DateTime.UtcNow.AddSeconds(10);
 | 
			
		||||
        while (session.IsCheckedOut)
 | 
			
		||||
        {
 | 
			
		||||
            if (DateTime.UtcNow > endTime)
 | 
			
		||||
                throw new TimeoutException();
 | 
			
		||||
            await Task.Delay(5);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return session;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public async Task UpdateSession(MdlSession session)
 | 
			
		||||
    {
 | 
			
		||||
        if (session != null)
 | 
			
		||||
        {
 | 
			
		||||
            string key = await _sessionIdManager.GetSessionIdAsync() ?? "";
 | 
			
		||||
            string ipAddress = await _sessionIdManager.GetIPAddressAsync() ?? "";
 | 
			
		||||
            Guid theSessionId;
 | 
			
		||||
 | 
			
		||||
            if (!Guid.TryParse(key, out theSessionId))
 | 
			
		||||
                theSessionId = Guid.Empty;//Guid.Parse(key);
 | 
			
		||||
 | 
			
		||||
            if (_sessions.ContainsKey(theSessionId))
 | 
			
		||||
            {
 | 
			
		||||
                //session = new MdlSession() { SessionId = key, IPAddress = ipAddress };
 | 
			
		||||
                session.SessionId = key;
 | 
			
		||||
                session.dtExpires = DateTimeOffset.Now.AddHours(36);    // Rolling expiration date
 | 
			
		||||
                _sessions[theSessionId] = session;
 | 
			
		||||
                _sessions[theSessionId].IsCheckedOut = false;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var sess = new MdlSession() { SessionId = key, IPAddress = ipAddress };
 | 
			
		||||
                _sessions[theSessionId] = session;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Remove stale sessions
 | 
			
		||||
            lock (syncLock1)
 | 
			
		||||
            {
 | 
			
		||||
                try
 | 
			
		||||
                {
 | 
			
		||||
                    var lstRemove = new HashSet<Guid>();
 | 
			
		||||
                    foreach (var kvp in _sessions)
 | 
			
		||||
                    {
 | 
			
		||||
                        if (kvp.Value.dtExpires < DateTimeOffset.Now && !lstRemove.Contains(kvp.Key))
 | 
			
		||||
                            lstRemove.Add(kvp.Key);
 | 
			
		||||
                    }
 | 
			
		||||
                    foreach (var rmv in lstRemove)
 | 
			
		||||
                        _sessions.Remove(rmv);
 | 
			
		||||
                    lstRemove.Clear();
 | 
			
		||||
                }
 | 
			
		||||
                catch (Exception ex)
 | 
			
		||||
                {
 | 
			
		||||
                    // do something
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    } //UpdateSession
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// Replace the contents of oldSession with the items
 | 
			
		||||
    /// in newSession.
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    /// <param name="newSession"></param>
 | 
			
		||||
    /// <param name="oldSession"></param>
 | 
			
		||||
    private void Replace(MdlSession newSession, MdlSession oldSession)
 | 
			
		||||
    {
 | 
			
		||||
        oldSession.Clear();
 | 
			
		||||
        foreach (var key in newSession.Keys)
 | 
			
		||||
            oldSession.Add(key, newSession[key]);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
<Project Sdk="Microsoft.NET.Sdk.Web">
 | 
			
		||||
 | 
			
		||||
  <PropertyGroup>
 | 
			
		||||
    <TargetFramework>net8.0</TargetFramework>
 | 
			
		||||
    <Nullable>enable</Nullable>
 | 
			
		||||
    <ImplicitUsings>enable</ImplicitUsings>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
 | 
			
		||||
  <Target Name="CustomActionsAfterPublish" AfterTargets="AfterPublish">
 | 
			
		||||
    <Exec Command="c:\misc\WaitForFolder $(PublishUrl) /nobeep" />
 | 
			
		||||
  </Target>
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <PackageReference Include="kmCommonLibsCore" Version="2.0.0.129" />
 | 
			
		||||
    <PackageReference Include="Telerik.SvgIcons" Version="4.2.0" />
 | 
			
		||||
    <PackageReference Include="Telerik.UI.for.Blazor" Version="8.1.1" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
 | 
			
		||||
</Project>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,25 @@
 | 
			
		|||
 | 
			
		||||
Microsoft Visual Studio Solution File, Format Version 12.00
 | 
			
		||||
# Visual Studio Version 17
 | 
			
		||||
VisualStudioVersion = 17.13.36105.23
 | 
			
		||||
MinimumVisualStudioVersion = 10.0.40219.1
 | 
			
		||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinterBestCustomerWebForm", "WinterBestCustomerWebForm.csproj", "{10E16044-8880-42A4-866B-B0461C450A71}"
 | 
			
		||||
EndProject
 | 
			
		||||
Global
 | 
			
		||||
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
			
		||||
		Debug|Any CPU = Debug|Any CPU
 | 
			
		||||
		Release|Any CPU = Release|Any CPU
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 | 
			
		||||
		{10E16044-8880-42A4-866B-B0461C450A71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{10E16044-8880-42A4-866B-B0461C450A71}.Debug|Any CPU.Build.0 = Debug|Any CPU
 | 
			
		||||
		{10E16044-8880-42A4-866B-B0461C450A71}.Release|Any CPU.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{10E16044-8880-42A4-866B-B0461C450A71}.Release|Any CPU.Build.0 = Release|Any CPU
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
	GlobalSection(SolutionProperties) = preSolution
 | 
			
		||||
		HideSolutionNode = FALSE
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
	GlobalSection(ExtensibilityGlobals) = postSolution
 | 
			
		||||
		SolutionGuid = {53B11938-C281-423B-8D9A-10AA81987064}
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
EndGlobal
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
{
 | 
			
		||||
    "Logging": {
 | 
			
		||||
        "LogLevel": {
 | 
			
		||||
            "Default": "Information",
 | 
			
		||||
            "Microsoft.AspNetCore": "Warning"
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
{
 | 
			
		||||
    "Logging": {
 | 
			
		||||
        "LogLevel": {
 | 
			
		||||
            "Default": "Information",
 | 
			
		||||
            "Microsoft.AspNetCore": "Warning"
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    "AllowedHosts": "*"
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,60 @@
 | 
			
		|||
html, body {
 | 
			
		||||
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a, .btn-link {
 | 
			
		||||
    color: #006bb7;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.btn-primary {
 | 
			
		||||
    color: #fff;
 | 
			
		||||
    background-color: #1b6ec2;
 | 
			
		||||
    border-color: #1861ac;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
 | 
			
		||||
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.content {
 | 
			
		||||
    padding-top: 1.1rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h1:focus {
 | 
			
		||||
    outline: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.valid.modified:not([type=checkbox]) {
 | 
			
		||||
    outline: 1px solid #26b050;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.invalid {
 | 
			
		||||
    outline: 1px solid #e51680;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.validation-message {
 | 
			
		||||
    color: #e51680;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.blazor-error-boundary {
 | 
			
		||||
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
 | 
			
		||||
    padding: 1rem 1rem 1rem 3.7rem;
 | 
			
		||||
    color: white;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    .blazor-error-boundary::after {
 | 
			
		||||
        content: "An error has occurred."
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
.sbWizard {
 | 
			
		||||
    text-align: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.vertical-buttons {
 | 
			
		||||
    flex-flow: row nowrap;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* set block display */
 | 
			
		||||
.block-buttons {
 | 
			
		||||
    display: flex;
 | 
			
		||||
}
 | 
			
		||||
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
| 
		 After Width: | Height: | Size: 1.8 MiB  | 
| 
		 After Width: | Height: | Size: 636 KiB  | 
| 
		 After Width: | Height: | Size: 7.0 MiB  | 
| 
		 After Width: | Height: | Size: 16 KiB  | 
| 
		 After Width: | Height: | Size: 228 KiB  | 
| 
		 After Width: | Height: | Size: 211 KiB  | 
| 
		 After Width: | Height: | Size: 294 KiB  | 
| 
		 After Width: | Height: | Size: 277 KiB  | 
| 
		 After Width: | Height: | Size: 154 KiB  | 
| 
		 After Width: | Height: | Size: 225 KiB  | 
| 
		 After Width: | Height: | Size: 136 KiB  | 
| 
		 After Width: | Height: | Size: 102 KiB  | 
| 
		 After Width: | Height: | Size: 100 KiB  | 
| 
		 After Width: | Height: | Size: 110 KiB  | 
| 
		 After Width: | Height: | Size: 222 KiB  | 
| 
		 After Width: | Height: | Size: 31 KiB  | 
| 
		 After Width: | Height: | Size: 41 KiB  | 
| 
		 After Width: | Height: | Size: 474 KiB  | 
| 
		 After Width: | Height: | Size: 762 KiB  | 
| 
		 After Width: | Height: | Size: 1.9 MiB  | 
| 
		 After Width: | Height: | Size: 6.0 KiB  | 
| 
		 After Width: | Height: | Size: 13 KiB  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 17 KiB  | 
| 
		 After Width: | Height: | Size: 2.7 KiB  | 
| 
		 After Width: | Height: | Size: 23 KiB  | 
| 
		 After Width: | Height: | Size: 46 KiB  | 
| 
		 After Width: | Height: | Size: 37 KiB  | 
| 
		 After Width: | Height: | Size: 50 KiB  |