Attempt to use PartialView
This commit is contained in:
@@ -29,6 +29,11 @@ namespace WebPostPartialJsonObject.Controllers
|
|||||||
HttpContext.Session.SetObject("KioskSettings", data);
|
HttpContext.Session.SetObject("KioskSettings", data);
|
||||||
return RedirectToAction("Index", "Settings");
|
return RedirectToAction("Index", "Settings");
|
||||||
}
|
}
|
||||||
|
[HttpPost, Consumes("application/json")]
|
||||||
|
public IActionResult Reprint(int ckinid)
|
||||||
|
{
|
||||||
|
return PartialView("Reprint");
|
||||||
|
}
|
||||||
|
|
||||||
public IActionResult Privacy()
|
public IActionResult Privacy()
|
||||||
{
|
{
|
||||||
|
|||||||
10
WebPostPartialJsonObject/Models/ReprintInfo.cs
Normal file
10
WebPostPartialJsonObject/Models/ReprintInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public class ReprintInfo
|
||||||
|
{
|
||||||
|
public IEnumerable<string> LabelSets { get; set; }
|
||||||
|
public IEnumerable<string> LabelNames { get; set; }
|
||||||
|
public int PrinterType { get; set; }
|
||||||
|
public string PrinterName { get; set; }
|
||||||
|
}
|
||||||
7
WebPostPartialJsonObject/Models/ReprintRequest.cs
Normal file
7
WebPostPartialJsonObject/Models/ReprintRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace WebPostPartialJsonObject.Models
|
||||||
|
{
|
||||||
|
public class ReprintRequest
|
||||||
|
{
|
||||||
|
public int CkInId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
8
WebPostPartialJsonObject/Views/Home/ReprintView.cshtml
Normal file
8
WebPostPartialJsonObject/Views/Home/ReprintView.cshtml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
@*
|
||||||
|
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||||
|
*@
|
||||||
|
@{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
<h1>Partial View</h1>
|
||||||
@@ -26,13 +26,44 @@
|
|||||||
<input type="submit" value="Save" class="btn btn-primary" />
|
<input type="submit" value="Save" class="btn btn-primary" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<div id="ReprintModal" class="modal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Select the labels you want to reprint</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">x</span></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="reprintLabelsForm"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn btn-outline-secondary" id="btnReprintLabels" data-toggle="modal" data-target="#reprintLabels" data-ckinid="123">
|
||||||
|
Reprint Label(s)
|
||||||
|
</button>
|
||||||
<div>
|
<div>
|
||||||
<a asp-action="Index">Back to List</a>
|
<a asp-action="Index">Back to List</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
@{
|
||||||
|
await Html.RenderPartialAsync("_ValidationScriptsPartial");
|
||||||
|
}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('#btnReprintLabels').click(function (e) { pickLabels(e, $(this)); });
|
||||||
|
|
||||||
|
function pickLabels(e, element) {
|
||||||
|
var id = element.data('ckinid');
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: '/Home/Reprint',
|
||||||
|
data: { 'ckinid': id },
|
||||||
|
success: function (response) {
|
||||||
|
$('#reprintLabelsForm').html(response);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user