文件操作 - Admin.js
返回文件管理
返回主菜单
删除本文件
文件: E:\HostingSpaces\kimblycr\crm.kimbly.in\wwwroot\js\Admin.js
编辑文件内容
function ShowPriviledges() { $("#DvPrivilege").show(); $("#LIPrivileges").attr("class", "active"); $("#DvHidden").hide(); $("#DvHidden").attr("class", ""); $("#DVEMail").hide(); $("#LIEMailSetup").attr("class", ""); $("#DVSMS").hide(); $("#LISMSSetup").attr("class", ""); GetEmployeesList(); } function ShowEMailSetup() { $("#DvPrivilege").hide(); $("#DVEMail").show(); $("#LIPrivileges").attr("class", ""); $("#LIEMailSetup").attr("class", "active"); $("#DVSMS").hide(); $("#LISMSSetup").attr("class", ""); $.ajax({ type: "POST", url: "Settings.aspx/GetMailServerSettings", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data.d != null) { document.getElementById("txtServerName").value = data.d[0].ServerName; document.getElementById("txtServerType").value = data.d[0].ServerType; document.getElementById("txtPort").value = data.d[0].Port; document.getElementById("txtEmail").value = data.d[0].DefaultEmailID; document.getElementById("txtPwd").value = data.d[0].DefaultPassword; if (data.d[0].Enabled == "False") { document.getElementById("ChkEMailEnabled").checked = false; } else { document.getElementById("ChkEMailEnabled").checked = true; } } } }); } function ShowSMSSetup() { $("#DvPrivilege").hide(); $("#DVEMail").hide(); $("#LIPrivileges").attr("class", ""); $("#LIEMailSetup").attr("class", ""); $("#DVSMS").show(); $("#LISMSSetup").attr("class", "active"); $.ajax({ type: "POST", url: "Settings.aspx/GetSMSSettings", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data.d != null) { document.getElementById("txtUserNameSMS").value = data.d[0].UserName; document.getElementById("txtSenderID").value = data.d[0].SenderID; document.getElementById("txtPwdSMS").value = data.d[0].Password; console.log(data.d[0].Enabled); if (data.d[0].Enabled == "False"){ document.getElementById("ChkSMSEnabled").checked = false; } else { document.getElementById("ChkSMSEnabled").checked = true; } if (data.d[0].SMS_Case_Open == "False") { document.getElementById("ChkSMSCaseOpen").checked = false; } else { document.getElementById("ChkSMSCaseOpen").checked = true; } if (data.d[0].SMS_Case_Close == "False") { document.getElementById("ChkSMSCaseClose").checked = false; } else { document.getElementById("ChkSMSCaseClose").checked = true; } } } }); } function GetEmployeesList() { $.ajax({ type: "POST", url: "WebMethods/Employees.aspx/GetEmployeesList", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data.d != null) { var select = document.getElementById('SelPrvEmp'); select.options.length = 0; var obj = JSON.parse(data.d); for (i = 0; i < obj.length; i++) { select.options[select.options.length] = new Option(obj[i].Name, obj[i].ID); } } } }); } function ShowRestrictions() { var f = document.getElementById("SelPrvModules"); var ModuleID = f.options[f.selectedIndex].value; var e = document.getElementById("SelPrvEmp"); var EmpID = e.options[e.selectedIndex].value; GetAllowed(ModuleID, EmpID); GetNotAllowed(ModuleID, EmpID); } function GetAllowed(ModuleID, EmpID) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Settings.aspx/GetNonAppliedRestForFormEmp", data: "{'ModuleID':'" + ModuleID + "','EmpID': '" + EmpID + "'}", dataType: "json", success: function (data) { $("#tblRestAllowed").empty(); var str = "<thead><tr><th>Action</th></tr></thead><tbody>"; for (var i = 0; i < data.d.length; i++) { var str1 = "'" + ModuleID + "','" + data.d[i].Action + "','" + EmpID + "'"; str += '<tr><td>' + data.d[i].Action + '</td><td><input type="button" id="btn" value="+" onclick="InsertRestriction(' + str1 + ')"/></td></tr>'; } $("#tblRestAllowed").append(str); $("#tblRestAllowed").append("</tbody>"); $("#tblRestAllowed").show(); $("#DvPrivilege").show(); }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); } function GetNotAllowed(ModuleID, EmpID) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Settings.aspx/GetRestrictionsByFormEmpID", data: "{'ModuleID':'" + ModuleID + "','EmpID': '" + EmpID + "'}", dataType: "json", success: function (data) { $("#tblRestNotAllowed").empty(); if (data.d != null) { var str = "<thead><tr><th>Action</th><th></th></tr></thead><tbody>"; for (var i = 0; i < data.d.length; i++) { str += '<tr><td>' + data.d[i].Action + '</td><td><input type="button" id="btn" value="-" onclick="RemoveRestriction(' + data.d[i].ID + ')"/></td></tr>'; } $("#tblRestNotAllowed").append(str); $("#tblRestNotAllowed").append("</tbody>"); $("#tblRestNotAllowed").show(); $("#DvPrivilege").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); } function InsertRestriction(moduleid, action, empid) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Settings.aspx/InsertRestrictions", data: "{'ModuleID':'" + moduleid + "','EmployeeID': '" + empid + "','Action': '" + action + "'}", dataType: "json", success: function (data) { ShowRestrictions(); }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); } function RemoveRestriction(id) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Settings.aspx/RemoveRestrictions", data: "{'ID':'" + id + "'}", dataType: "json", success: function (data) { ShowRestrictions(); }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); } function UpdateEmailServer() { var ServerName = document.getElementById("txtServerName").value; var ServerType = document.getElementById("txtServerType").value; var Port = document.getElementById("txtPort").value; var DefaultEmailID = document.getElementById("txtEmail").value; var Password = document.getElementById("txtPwd").value; var Enabled = document.getElementById("ChkSMSEnabled").checked; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Settings.aspx/UpdateEmailServer", data: "{'ServerName':'" + ServerName + "','ServerType': '" + ServerType + "','Port': '" + Port + "','DefaultEmailID': '" + DefaultEmailID + "','Password': '" + Password + "'}", dataType: "json", success: function (data) { showToast("Done"); }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); } function UpdateSMSServer() { var UserName = document.getElementById("txtUserNameSMS").value; var SenderID = document.getElementById("txtSenderID").value; var Password = document.getElementById("txtPwdSMS").value; var Enabled = document.getElementById("ChkSMSEnabled").checked; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Settings.aspx/UpdateSMSServer", data: "{'UserName':'" + UserName + "','SenderID': '" + SenderID + "','Password': '" + Password + "','Enabled': '" + Enabled + "'}", dataType: "json", success: function (data) { showToast("Done"); }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件