EOS/Scripts/AuditLog/auditLog.js
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

75 lines
2.0 KiB
JavaScript

/**
* This file contains functions to show Audit Log Report.
* @module AuditLogModule
*/
/**
* @class AuditLog
*/
var activeRequest, startDate, endDate;
/**
* This Function sent a request to the server to show auditLog baed on start date and date.
* @method showAuditLog
* @for AuditLog
*/
function showAuditLog() {
startDate = $("#StartDate").val();
endDate = $("#EndDate").val();
// call controller AuditLog with start & endDate
if (activeRequest && activeRequest.readystate != 4) {
activeRequest.abort();
}
activeRequest = $.post("/AuditLog/ShowAuditLog/", { startDate: startDate, endDate: endDate }, function (data) {
// update recived data in table.
$('#divRightContent').html(data);
});
}
/**
* Set endDate value and maximum selection of date based on the Start Date.
* @method onChangeDateSelection
* @for AuditLog
*/
function onChangeDateSelection() {
onChangeStartDateInTrending("StartDate", "EndDate");
}
/**
* This Function sent a request to the server to download auditLogs in Excel file.
* @method exportXlsAuditLog
* @for AuditLog
*/
function exportXlsAuditLog() {
startDate = $("#StartDate").val();
endDate = $("#EndDate").val();
// call controller AuditLog with start & endDate
$.post("/AuditLog/ExportXlsAuditLog/", { startDate: startDate, endDate: endDate }, function (result) {
window.location.href = result;
});
}
/**
* To Show or hide excel icon for AuditLog Report and update message for no data found.
* @method showHideExcelIcon_AuditLog
* @for AuditLog
*/
function showHideExcelIcon_AuditLog() {
$("#divNoDataFound_AuditLog span p:first").text(messageJosn.noDataFound);
$("#divNoDataFound_AuditLog span p:last").text(messageJosn.differentCriteria);
if ($("#grid_AuditLog").length > 0) {
$(".excelIcon").show();
}
else {
$(".excelIcon").hide();
}
}
/*============================================================*/
$(document).ready(function () {
// Call showAuditLog() to show audit log details for first time.
showAuditLog();
})