📄 getclientxml.asp
字号:
<%@ LANGUAGE=JavaScript %>
<%
var xmlDocObject = Server.CreateObject("Microsoft.XMLDOM");
var common = Server.CreateObject("CommonFunctionality.WSC");
var conn = common.getDatabaseObject();
var fileName = Request.QueryString("file");
var createdBy = common.replaceQuotes(Request.QueryString("createdBy"));
xmlDocObject.async=false;
xmlDocObject.load(Request);
var startDate = xmlDocObject.documentElement.getAttribute("startDate");
//check to see if the timesheet exists
var sql = "select FileID from TimesheetList where FileName = '" + fileName + "' and CreatedBy = '" + createdBy + "'";
var rs = conn.Execute(sql);
if (rs.EOF){
//if the timesheet does not exist insert it into the timesheetlist table and
//retrieve the id for the record
sql = "insert into TimesheetList (FileName, CreatedBy, StartDate) values ('";
sql += fileName + "', '" + createdBy + "', '" + startDate + "')";
conn.Execute(sql);
sql = "select FileID from TimesheetList where FileName = '" + fileName + "' and CreatedBy = '" + createdBy + "'";
rs = conn.Execute(sql);
if (rs.EOF)
Response.Write("Unsuccessful");
else
fileID = rs(0);
}
else{
//if the timesheet exists then delete the details for the sheet
fileID = rs(0);
sql = "delete from TimesheetDetail where FileID = " + fileID
conn.Execute(sql);
}
var tasks = xmlDocObject.selectNodes("//task");
var task = tasks.nextNode();
var day, clientID, startTime, endTime, description;
while (task != null){
sql = "insert into TimesheetDetail (FileID, Day, ClientID, StartTime, EndTime, Description) values (";
day = task.getAttribute("day");
clientID = common.replaceQuotes(task.getAttribute("clientID"));
startTime = task.getAttribute("startTime");
endTime = task.getAttribute("endTime");
description = common.replaceQuotes(task.text);
sql += fileID + ", '" + day + "', '" + clientID + "', '" + startTime + "', '" + endTime + "', '" + description + "')";
conn.Execute(sql);
task = tasks.nextNode();
}
Response.Write("accepted");
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -