<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="net.sz600.database.*" %>
<%@ page import="java.util.*,java.sql.*,DBstep.iDBManager2000.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%
String mRecordID=request.getParameter("RecordID");
String mFileName=new String(request.getParameter("FileName").getBytes("8859_1"));
String mDescript=new String(request.getParameter("Descript").getBytes("8859_1"));

//判断模板名称是否存在
SzDataReader dataReader = new SzDataReader();
String sCond = "FileName = '"+ mFileName +"' AND RecordID<>'"+ mRecordID +"'";
boolean flag = dataReader.isExist("Template_File", sCond);
dataReader.closeAll();
if (!flag) {
	DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000();
	if (DbaObj.OpenConnection()){
  		java.sql.PreparedStatement prestmt=null;
		String mSql="Update Template_File Set GSID=" + szCOMPANY_SESSION + ", FileName = '"+ mFileName +"',Descript = '"+ mDescript +"' Where RecordID='"+ mRecordID +"'";

  		prestmt =DbaObj.Conn.prepareStatement(mSql);
  		//DbaObj.Conn.setAutoCommit(false) ;
  		prestmt.execute();
  		//DbaObj.Conn.commit();
  		prestmt.close();
	}
	DbaObj.CloseConnection();
	response.sendRedirect("TemplateList.jsp");

} else {
    out.println(SzPageHelp.jsAlertBack("模板名称已经存在！"));
}


%>
