Untitled

mail@pastecode.io avatar
unknown
plain_text
23 days ago
1.7 kB
2
Indexable
Never
// Construct object with form data and order lines
var formData = {
    //Order ids
    IdOrderSup: $('#idOrderSup').val(),
    IdOrderCli: $('#idOrderCli').val(),
    //Supplier order
    SupplierIdSelect: $('#supplierIdSelect').val(),
    PurchaseOrder: $('#purchaseOrder').val(),
    DescriptionSupplier: $('#descriptionSupplier').val(),
    ResponsibleEmailSupplier: $('#responsibleEmailSupplier').val(),
    ResponsibleNameSupplier: $('#responsibleNameSupplier').val(),
    NotesSupplier: $('#notesSupplier').val(),
    //Client order
    ClientIdSelect: $('#clientIdSelect').val(),
    RequestOrder: $('#requestOrder').val(),
    DescriptionClient: $('#descriptionClient').val(),
    ResponsibleEmailClient: $('#responsibleEmailClient').val(),
    ResponsibleNameClient: $('#responsibleNameClient').val(),
    NotesClient: $('#notesClient').val(),
};

// Send an AJAX request to the controller
$.ajax({
    url: '/Orders/_Edit',
    type: 'post',
    data: formData,
    success: function (response) {                    
        console.log('Form submitted successfully');
        $('#editOrderModal').modal('toggle');
        location.reload();
    },
    error: function (xhr, status, error) {                   
        console.error('Error submitting form');
        console.error(xhr.responseText);
    }
});

 [HttpPost]
 public async Task<IActionResult> _Edit(int? IdOrderSup, int? IdOrderCli, int SupplierIdSelect, string PurchaseOrder, string DescriptionSupplier, string ResponsibleEmailSupplier,
     string ResponsibleNameSupplier, string NotesSupplier, int ClientIdSelect, string RequestOrder, string DescriptionClient,
     string ResponsibleEmailClient, string ResponsibleNameClient, string NotesClient)
 {
Leave a Comment