From 57946e64d5685f65598603a743c576e9f618d841 Mon Sep 17 00:00:00 2001 From: Tracy Pearson Date: Sat, 10 Dec 2022 01:16:37 -0500 Subject: [PATCH] Attempt to use PartialView --- .../Controllers/HomeController.cs | 5 +++ .../Models/ReprintInfo.cs | 10 ++++++ .../Models/ReprintRequest.cs | 7 ++++ .../Views/Home/ReprintView.cshtml | 8 +++++ .../Views/Settings/Index.cshtml | 35 +++++++++++++++++-- 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 WebPostPartialJsonObject/Models/ReprintInfo.cs create mode 100644 WebPostPartialJsonObject/Models/ReprintRequest.cs create mode 100644 WebPostPartialJsonObject/Views/Home/ReprintView.cshtml diff --git a/WebPostPartialJsonObject/Controllers/HomeController.cs b/WebPostPartialJsonObject/Controllers/HomeController.cs index ca9ab0d..c1eafb1 100644 --- a/WebPostPartialJsonObject/Controllers/HomeController.cs +++ b/WebPostPartialJsonObject/Controllers/HomeController.cs @@ -29,6 +29,11 @@ namespace WebPostPartialJsonObject.Controllers HttpContext.Session.SetObject("KioskSettings", data); return RedirectToAction("Index", "Settings"); } + [HttpPost, Consumes("application/json")] + public IActionResult Reprint(int ckinid) + { + return PartialView("Reprint"); + } public IActionResult Privacy() { diff --git a/WebPostPartialJsonObject/Models/ReprintInfo.cs b/WebPostPartialJsonObject/Models/ReprintInfo.cs new file mode 100644 index 0000000..1c64d00 --- /dev/null +++ b/WebPostPartialJsonObject/Models/ReprintInfo.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; + +public class ReprintInfo +{ + public IEnumerable LabelSets { get; set; } + public IEnumerable LabelNames { get; set; } + public int PrinterType { get; set; } + public string PrinterName { get; set; } +} \ No newline at end of file diff --git a/WebPostPartialJsonObject/Models/ReprintRequest.cs b/WebPostPartialJsonObject/Models/ReprintRequest.cs new file mode 100644 index 0000000..75edd57 --- /dev/null +++ b/WebPostPartialJsonObject/Models/ReprintRequest.cs @@ -0,0 +1,7 @@ +namespace WebPostPartialJsonObject.Models +{ + public class ReprintRequest + { + public int CkInId { get; set; } + } +} diff --git a/WebPostPartialJsonObject/Views/Home/ReprintView.cshtml b/WebPostPartialJsonObject/Views/Home/ReprintView.cshtml new file mode 100644 index 0000000..7e42232 --- /dev/null +++ b/WebPostPartialJsonObject/Views/Home/ReprintView.cshtml @@ -0,0 +1,8 @@ +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@{ + +} + +

Partial View

diff --git a/WebPostPartialJsonObject/Views/Settings/Index.cshtml b/WebPostPartialJsonObject/Views/Settings/Index.cshtml index 576cac4..941c3df 100644 --- a/WebPostPartialJsonObject/Views/Settings/Index.cshtml +++ b/WebPostPartialJsonObject/Views/Settings/Index.cshtml @@ -26,13 +26,44 @@ + - +
Back to List
@section Scripts { - @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + } + + }