⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delquestionanswer.jsp

📁 电信的网厅的整站代码
💻 JSP
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.doone.data.*" %>
<%@ page import="com.doone.uurm.WebAuth"%>
<%@ page import="com.doone.fj1w.fj1w.faq.*" %>
<%@ page import="com.doone.util.*" %>
<%String sPurvICode="NGB009";%>
<%!
	void deleteFaqContent(DacClient db, long faqID) {
		Tf_Faq faq = new Tf_Faq(db, faqID);

		DataTable dt = faq.getChildList(0,-1);
		for ( int i=0; i<dt.getRows().getCount(); i++ ) {
			Tf_Faq faq1 = new Tf_Faq(db, dt.getRow(i).getLong("FAQID"));

			deleteFaqContent(db, faq1.getFaqId());

			faq1.delete();
			faq1.save();
		}

		faq.delete();
		faq.save();
	}
%>
<%// 获取栏目列表,同时统计帖子数。
	WebAuth auth = WebAuth.getInstance(request);

    if ( ! auth.IsAuthed() ) {
	    out.write("<script language=\"javascript\">self.parent.location.replace(\"" + request.getContextPath() + "/view/login/login.jsp" + "\");</script>");
	    return;
    }
	else if ( ! auth.CheckPurv(sPurvICode) ) {
	    out.write("<script language=javascript src=\"../../common/script/RightForbidden.js\"></script>");
	    return;
	}
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>FAQ记录删除</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <link href="../../common/style/main.css" rel="stylesheet" type="text/css" />
    <script language="javascript">  
        function fn_close(){
            try{
                //alert("OK");
                var parentObj = self.opener;
                //alert(parentObj.location.href);
                parentObj.location.replace(parentObj.location.href);
            }catch(e){alert("关闭失败。");}
        }
        
        window.onunload = fn_close;
    </script>
</head>
<body>
    <script language="JavaScript" src="../../common/script/ChangeStyle.js"></script>
    <table width="100%" border="0" cellpadding="2" cellspacing="1" class="OuterTable">
        <tr>
            <td class="OuterHead" colspan="8">
                <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                        <td nowrap="nowrap" style="text-align: left">
                            <span id="ItemTitle"><font face="webdings">8</font>提示信息</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="InnerMain" colspan="8">
                <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                        <td nowrap="nowrap" style="text-align: left"><%
    String[] aFaqid = request.getParameterValues("faqid");
    DacClient db = new DacClient();
    try{
        db.beginTransaction(-1);
        for ( int i=0; i<aFaqid.length; i++){
            if ( aFaqid[i] != null && aFaqid[i].equals("") ) continue;
            
			Tf_Faq faq = new Tf_Faq(db, Long.parseLong(aFaqid[i]));

			// 更新父帖的子帖数。
			if ( faq.getUpFaqId() > 0 ) {
			  Tf_Faq faq1 = new Tf_Faq(db, faq.getUpFaqId());
			  faq1.setSubCount(faq1.getSubCount()-1);
			  faq1.save();
			}
		
            deleteFaqContent(db, Long.parseLong(aFaqid[i]));
        }
        
        db.endTransaction(true);
        out.print("记录删除成功。");
    }
    catch(Exception ex){
        try{
            db.endTransaction(false);
        }catch(Exception e){}

        FileLogger.getLogger().error("删除FAQ记录时出错。", ex);
        out.print("记录删除失败,请关闭后再试,如果还有问题请与管理员联系。");
    }
                        %>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="OuterFoot" colspan="8" align="right" nowrap>
                <input type="button" class="button" value="关闭" style="width: 40" onclick="self.close();" />
            </td>
        </tr>
    </table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -