Open Emmanuelf7 opened 1 year ago
function saveCategory() {
var category = new Object(); category.CategoryId = $("#categoryId").val(); category.CategoryName = $("#categoryName").val(); category.Status = $("#status").val(); var data = JSON.stringify({ category: category }); document.getElementById('success-message').onclick = function () { swal('Success!', 'Category is Saved!', 'success') }; swal({ Position:'top-end', icon: "success", title: 'Your work has been saved', showConfirmButton: false, timer:1500 }).then(function (isConfirm) { if (isConfirm) { return $.ajax({ contentType: 'application/json; charset=ut-8', dataType: 'json', type: 'POST', url: "/Home/SaveCategory", data: data, success: function (result) { if (result == true) { GetAllCategory(); dataTable.ajax.reload(); } } }); } else { swal("Cancelled", "You have Cancelled Form Submission!", "error"); $("#categoryModal").modal('hide'); } }); }
function saveCategory() {