?? wptype.java
字號:
package JXC.web;
import JXC.Com.DBConnect;
import java.lang.String;
import JXC.util.StrFun;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* Title: 明細單信息
* Description:
* Copyright: Copyright (c) 2003
* Company: torch
* @author: wind
* @version 1.0
*/
public class wptype{
private int ID;
private String bh;
private String name;
private String bz;
public void wptype(){}
public int getID() {
return ID;
}
public void setID(int anew) {
this.ID=anew;
}
public void setID(String anew){
if (anew!=null)
this.ID = Integer.parseInt(anew);
}
public String getBh() {
return bh;
}
public void setBh(String anew) {
this.bh=anew;
}
public String getName() {
return name;
}
public void setName(String anew) {
this.name=anew;
}
public String getBz() {
return bz;
}
public void setBz(String anew) {
this.bz=anew;
}
public boolean excute() throws Exception {
String Str="Select * From wptype where Id="+ID;
try {
DBConnect dbc = new DBConnect(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs = dbc.executeQuery(Str);
if (rs.next()){
ID=rs.getInt("ID");
bh=rs.getString("bh");
name=rs.getString("name");
bz=rs.getString("bz");
}
rs.close();
dbc.close();
return true;
}
catch (SQLException sqle){
return false;
}
}
public void Edit(HttpServletRequest request) throws Exception {
ID=StrFun.getInt(request,"id");
bh=StrFun.getString(request,"bh");
name=StrFun.getString(request,"name");
bz=StrFun.getString(request,"bz");
String Str="Update wptype set bh='"+bh+"' ,name='"+name+"' ,bz='"+bz+"' where id="+ID;
DBConnect dbc = new DBConnect();
dbc.executeUpdate(Str);
dbc.close();
}
public void Add(HttpServletRequest request) throws Exception {
bh=StrFun.getString(request,"bh");
name=StrFun.getString(request,"name");
bz=StrFun.getString(request,"bz");
String Str="Insert into wptype(bh,name,bz) values('"+bh+"','"+name+"','"+bz+"')";
DBConnect dbc = new DBConnect();
dbc.executeUpdate(Str);
dbc.close();
}
public void Del() throws Exception {
String Str="Delete From wptype where Id="+ID;
DBConnect dbc = new DBConnect();
dbc.executeUpdate(Str);
dbc.close();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -