文件操作 - Load.js
返回文件管理
返回主菜单
删除本文件
文件: E:\HostingSpaces\kimblycr\crm.kimbly.in\wwwroot\js\Load.js
编辑文件内容
oldBox = "#Home"; var LoggedInEmpID; var LoginName; var UserType; $(document).ready(function () { LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); console.log('LoggedInEmpID-' + LoggedInEmpID); LoginName = sessionStorage.getItem("LoginName"); UserType = sessionStorage.getItem("UserType"); oldBox = "#Home"; showHome(); showSummary(); $(".displayBlock").click(function () { $("#infoContainer").children().hide(); $("#secondScreen").show(); var e = $(this).attr("id").substring(3); console.log('e-' + e); if (e == 'Enquiries') { getAlerts(); } else if (e == 'Support') { getAlertsSupport(); } $("#" + e).show(); }); $.ajaxSetup({ beforeSend: function () { $("#loading").show() }, complete: function () { $("#loading").hide() } }) CheckSearchRestrictions(); CheckAddRestrictions(); CheckDeductRestrictions(); CheckSettingsRestriction(); }) function showHome() { console.log('In show Home'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Home").show(); $("#dvSummary").hide(); getAlerts(); } function showSummary() { console.log('In showSummary'); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "index.aspx/getSummary", data: "", dataType: "json", success: function (data) { if (data.d != null) { document.getElementById('lblEnqCount').innerHTML = data.d[0].RowData; document.getElementById('lblSupportCount').innerHTML = data.d[1].RowData; document.getElementById('lblEnqTodayCount').innerHTML = data.d[2].RowData; document.getElementById('lblSupportTodayCount').innerHTML = data.d[3].RowData; document.getElementById('lblSalesAlertCount').innerHTML = data.d[4].RowData; document.getElementById('lblSupportAlertCount').innerHTML = data.d[5].RowData; $("#dvSummary").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('error'); } }); } function getAlerts() { console.log('In getAlerts'); document.getElementById('AlertPanelBody').innerHTML = ""; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "index.aspx/GetPendingEnquiryAlerts", data: "", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var cols = data.d[i].RowData.split(';'); showAlerts(cols[1] + " " + cols[2] + " " + cols[3], "Enquiries", cols[4]); } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('error'); } }); } function getAlertsSupport() { console.log('In getAlertsSupport'); document.getElementById('SupportAlertPanelBody').innerHTML = ""; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "index.aspx/GetPendingSupportAlerts", data: "", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var cols = data.d[i].RowData.split(';'); showAlertsSupport(cols[1] + " " + cols[2] + " " + cols[3], cols[4]); } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('error'); } }); } function showAlerts(alrt, module, id) { console.log('In showAlert'); var htmlexist = document.getElementById('AlertPanelBody').innerHTML; document.getElementById('AlertPanelBody').innerHTML = htmlexist + '<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><a href="#" onclick="EditEnquiries(' + id + ')">' + alrt + '</a></div>'; } function showAlertsSupport(alrt, id) { console.log('In showAlertsSupport'); var htmlexist = document.getElementById('SupportAlertPanelBody').innerHTML; document.getElementById('SupportAlertPanelBody').innerHTML = htmlexist + '<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><a href="#" onclick="EditSupport(' + id + ')">' + alrt + '</a></div>'; } function CheckSearchRestrictions() { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Contacts.aspx/GetSearchRestrictionByEmpID", data: "", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var nm = data.d[i].RowData; console.log('nm-' + nm); if (nm == "Contacts") { $("#btnSearchContacts").hide(); } else if (nm == "Enquiries") { $("#BtnEnquirySearch").hide(); } else if (nm == "Quotes") { $("#BtnQuoteSearch").hide(); } else if (nm == "Complaints") { $("#BtnComplaintSearch").hide(); } else if (nm == "Products") { $("#BtnProductSearch").hide(); } else if (nm == "Inventory") { $("#BtnInventorySearch").hide(); } else if (nm == "Employees") { $("#BtnEmployeeSearch").hide(); } else if (nm == "Docs") { $("#BtnDocsSearch").hide(); } else if (nm == "AMC") { $("#BtnAMCSearch").hide(); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('error'); } }); } function CheckAddRestrictions() { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Contacts.aspx/GetAddRestrictionByEmpID", data: "", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var nm = data.d[i].RowData; if (nm == "Contacts") { $("#btnContactsAdd").hide(); } else if (nm == "Enquiries") { $("#BtnEnquiryAdd").hide(); } else if (nm == "Quotes") { $("#BtnQuoteAdd").hide(); } else if (nm == "Complaints") { $("#BtnComplaintAdd").hide(); } else if (nm == "Products") { $("#BtnProductAdd").hide(); } else if (nm == "Inventory") { $("#BtnInventoryAdd").hide(); } else if (nm == "Employees") { $("#BtnEmployeeAdd").hide(); } else if (nm == "Docs") { $("#BtnDocsAdd").hide(); } else if (nm == "AMC") { $("#BtnAMCAdd").hide(); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('error'); } }); } function CheckDeductRestrictions() { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Contacts.aspx/GetDeductRestrictionByEmpID", data: "", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var nm = data.d[i].RowData; if (nm == "Inventory") { $("#BtnInventoryDeduct").hide(); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('error'); } }); } function CheckSettingsRestriction() { console.log('In CheckSettingsRestriction'); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "index.aspx/GetSettingsRestriction", data: "", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var nm = data.d[i].RowData; if (nm == "Settings") { $("#boxSettings").hide(); } else if (nm == "Reports") { $("#boxReports").hide(); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('error'); } }); }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件