This commit is contained in:
Loretta 2025-11-01 00:47:06 +01:00
commit db14a5add1
2 changed files with 23 additions and 19 deletions

View File

@ -224,6 +224,7 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Controllers
[HttpPost] [HttpPost]
public async Task<IActionResult> ProcessShippingDocument(int shippingDocumentId) public async Task<IActionResult> ProcessShippingDocument(int shippingDocumentId)
{ {
var shippingDocument = await _dbContext.ShippingDocuments.GetByIdAsync(shippingDocumentId);
return Ok("Ok"); return Ok("Ok");
} }

View File

@ -1,6 +1,6 @@
@model Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Models.TestGridModel @model Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Models.TestGridModel
@using DevExtreme.AspNet.Mvc @using DevExtreme.AspNet.Mvc
@Html.AntiForgeryToken()
@{ @{
var contextId = Model.DataContext["contextId"]; var contextId = Model.DataContext["contextId"];
@ -63,25 +63,28 @@
<script> <script>
// Process Shipping Document function // Process Shipping Document function
function processShippingDocument_@(contextId)() { function processShippingDocument_@(contextId)() {
var shippingDocumentId = @contextId; var shippingDocumentId = @contextId;
$.ajax({ $.ajax({
url: '@Url.Action("ProcessShippingDocument", "ManagementPage")', url: '@Url.Action("ProcessShippingDocument", "ManagementPage")',
type: 'POST', type: 'POST',
data: { shippingDocumentId: shippingDocumentId }, data: {
success: function(response) { shippingDocumentId: shippingDocumentId,
DevExpress.ui.notify("Shipping document processed successfully!", "success", 2000); __RequestVerificationToken: $('input[name="__RequestVerificationToken"]').val()
// Refresh the file manager },
var fileManager = $("#@fileManagerId").dxFileManager("instance"); success: function(response) {
if (fileManager) { DevExpress.ui.notify("Shipping document processed successfully!", "success", 2000);
fileManager.refresh(); // Refresh the file manager
} var fileManager = $("#@fileManagerId").dxFileManager("instance");
}, if (fileManager) {
error: function(xhr, status, error) { fileManager.refresh();
DevExpress.ui.notify("Error processing shipping document: " + error, "error", 3000);
} }
}); },
} error: function(xhr, status, error) {
DevExpress.ui.notify("Error processing shipping document: " + error, "error", 3000);
}
});
}
function fileUploader_valueChanged(e) { function fileUploader_valueChanged(e) {
var files = e.value; var files = e.value;