📄 canceldoc.java
字号:
//Source file: D:\tomcat\webapps\wuyang\WEB-INF\classes\src\wuyang\src\CancelDoc.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class CancelDoc extends ShangObject
{
/**
进出口合同号
*/
private String contractId;
/**
核销单号
*/
private String cancelDocId;
/**
结算方式
*/
private int countupMode;
/**
备注
*/
private String comment;
public CancelDoc()
{
primarykey1Name = "cancelDocId";
primarykey1Type = 1;
tableName = "CancelDoc";
viewName = "CancelDoc";
numInOnePager = 10;
}
/**
* Access method for the contractId property.
*
* @return the current value of the contractId property
*/
public String getContractId()
{
return contractId;
}
/**
* Sets the value of the contractId property.
*
* @param aContractId the new value of the contractId property
*/
public void setContractId(String aContractId)
{
contractId = setChnString(aContractId);
}
/**
* Access method for the cancelDocId property.
*
* @return the current value of the cancelDocId property
*/
public String getCancelDocId()
{
return cancelDocId;
}
/**
* Sets the value of the cancelDocId property.
*
* @param aCancelDocId the new value of the cancelDocId property
*/
public void setCancelDocId(String aCancelDocId)
{
cancelDocId = setChnString(aCancelDocId);
}
/**
* Access method for the countupMode property.
*
* @return the current value of the countupMode property
*/
public int getCountupMode()
{
return countupMode;
}
/**
* Sets the value of the countupMode property.
*
* @param aCountupMode the new value of the countupMode property
*/
public void setCountupMode(int aCountupMode)
{
countupMode = aCountupMode;
}
/**
* Access method for the comment property.
*
* @return the current value of the comment property
*/
public String getComment()
{
return comment;
}
/**
* Sets the value of the comment property.
*
* @param aComment the new value of the comment property
*/
public void setComment(String aComment)
{
comment = setChnString(aComment);
}
public int loadAttr()
{
try {
contractId = getRsString(rs,"contractId");
cancelDocId = getRsString(rs, "cancelDocId");
countupMode = rs.getInt("countupMode");
comment = getRsString(rs,"comment");
}
catch(SQLException e)
{
e.printStackTrace();
System.out.println("query failed!");
return -1;
}
return 1;
}
public int insert()
{
String sql= "INSERT INTO CancelDoc (contractId,cancelDocId,countupMode,comment) "+
"VALUES ('"+getContractId()+"','"+getCancelDocId()+"',"+
getCountupMode()+",'"+getComment()+"')";
System.out.println(sql);
try {
Statement stmt=conn.createStatement();
stmt.execute(sql);
return 0;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -104;
}
}
public int update()
{
String sql= "UPDATE CancelDoc SET contractId='"+getContractId()+"',countupMode="+
getCountupMode()+",comment='"+getComment()+"' "+
"WHERE cancelDocId='" + getCancelDocId() + "'";
System.out.println(sql);
try {
Statement stmt=conn.createStatement();
stmt.execute(sql);
return 0;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -103;
}
}
public String getWhereClause(javax.servlet.ServletRequest request)
{
String whereClause = "";
String str;
int queryMode = (new Integer(request.getParameter("queryMode"))).intValue();
switch(queryMode)
{
case 1: // 综合查询
whereClause = addWhereClause(whereClause, "contractId", "=", "'", request.getParameter("contractId"));
whereClause = addWhereClause(whereClause, "cancelDocId", "=", "'", request.getParameter("cancelDocId"));
whereClause = addWhereClause(whereClause, "countupMode", "=", "", request.getParameter("countupMode"));
break;
case 2:
break;
}
return whereClause;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -