?? forumlinkadmin.java
字號:
package net.acai.forum.admin;
/**
* Title: 阿菜網(wǎng)絡
* Description:
* Copyright: Copyright (c) 2002
* Company: www.justhis.com
* @author: acai
* @version 1.0
*/
import net.acai.forum.*;
import net.acai.database.*;
import javax.servlet.http.*;
import java.sql.*;
import net.acai.util.*;
public class ForumLinkAdmin{
public ForumLinkAdmin(){}
public static void saveNew(HttpServletRequest request) throws Exception{
String url=ParamUtil.getString(request,"url");
String readme=ParamUtil.getString(request,"readme");
String name=ParamUtil.getString(request,"name");
if(url==null||readme==null||name==null)
throw new Exception("請輸入完整聯(lián)盟論壇信息。");
DBConnect dbc=new DBConnect("insert into bbslink(boardname,readme,url) values(?,?,?)");
dbc.setBytes(1,name.getBytes("GBK"));
dbc.setBytes(2,readme.getBytes("GBK"));
dbc.setBytes(3,url.getBytes("GBK"));
dbc.executeUpdate();
dbc.close();
}
public static void saveEdit(HttpServletRequest request) throws Exception{
int forumLinkID;
try{
forumLinkID=ParamUtil.getInt(request,"id");
}
catch(Exception e){
throw new Exception("請您選擇論壇的ID.");
}
DBConnect dbc=new DBConnect("update bbslink set boardname=?,readme=?,url=? where id="+forumLinkID);
dbc.setBytes(1,ParamUtil.getString(request,"name","").getBytes("GBK"));
dbc.setBytes(2,ParamUtil.getString(request,"readme","").getBytes("GBK"));
dbc.setBytes(3,ParamUtil.getString(request,"url","").getBytes("GBK"));
dbc.executeUpdate();
dbc.close();
}
public static void del(HttpServletRequest request) throws Exception{
int forumLinkID;
try{
forumLinkID=ParamUtil.getInt(request,"id");
}
catch(Exception e){
throw new Exception("請您選擇論壇的ID.");
}
DBConnect dbc=new DBConnect("delete from bbslink where id="+forumLinkID);
dbc.executeUpdate();
dbc.close();
}
public static void updateOrders(HttpServletRequest request) throws Exception{
int newforumLinkID;
int forumLinkID;
try{
newforumLinkID=ParamUtil.getInt(request,"newid");
forumLinkID=ParamUtil.getInt(request,"id");
}
catch(Exception e){
throw new Exception("請您選擇論壇的ID.");
}
DBConnect dbc=new DBConnect("update bbslink set id="+newforumLinkID+" where id="+forumLinkID);
dbc.executeUpdate();
dbc.close();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -