?? creditdoc.java
字號:
//Source file: D:\tomcat\webapps\wuyang\WEB-INF\classes\src\wuyang\src\CreditDoc.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class CreditDoc extends ShangObject
{
/**
進出口合同號
*/
private String contractId;
/**
信用證編號
*/
private String protocolId;
/**
開戶銀行
*/
private String bank;
/**
信用銀行
*/
private String creditBank;
/**
開戶金額
*/
private float bankMoney;
/**
保證金額
*/
private float creditMoney;
/**
遠期/近期
0 遠
1 近
*/
private int dateType;
/**
用途
*/
private String useway;
/**
進口批文號
*/
private String documentId;
public CreditDoc()
{
primarykey1Name = "protocolId";
primarykey1Type = 1;
tableName = "CreditDoc";
viewName = "CreditDoc";
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 protocolId property.
*
* @return the current value of the protocolId property
*/
public String getProtocolId()
{
return protocolId;
}
/**
* Sets the value of the protocolId property.
*
* @param aProtocolId the new value of the protocolId property
*/
public void setProtocolId(String aProtocolId)
{
protocolId = setChnString(aProtocolId);
}
/**
* Access method for the bank property.
*
* @return the current value of the bank property
*/
public String getBank()
{
return bank;
}
/**
* Sets the value of the bank property.
*
* @param aBank the new value of the bank property
*/
public void setBank(String aBank)
{
bank = setChnString(aBank);
}
/**
* Access method for the creditBank property.
*
* @return the current value of the creditBank property
*/
public String getCreditBank()
{
return creditBank;
}
/**
* Sets the value of the creditBank property.
*
* @param aCreditBank the new value of the creditBank property
*/
public void setCreditBank(String aCreditBank)
{
creditBank = setChnString(aCreditBank);
}
/**
* Access method for the bankMoney property.
*
* @return the current value of the bankMoney property
*/
public float getBankMoney()
{
return bankMoney;
}
/**
* Sets the value of the bankMoney property.
*
* @param aBankMoney the new value of the bankMoney property
*/
public void setBankMoney(float aBankMoney)
{
bankMoney = aBankMoney;
}
/**
* Access method for the creditMoney property.
*
* @return the current value of the creditMoney property
*/
public float getCreditMoney()
{
return creditMoney;
}
/**
* Sets the value of the creditMoney property.
*
* @param aCreditMoney the new value of the creditMoney property
*/
public void setCreditMoney(float aCreditMoney)
{
creditMoney = aCreditMoney;
}
/**
* Access method for the dateType property.
*
* @return the current value of the dateType property
*/
public int getDateType()
{
return dateType;
}
/**
* Sets the value of the dateType property.
*
* @param aDateType the new value of the dateType property
*/
public void setDateType(int aDateType)
{
dateType = aDateType;
}
/**
* Access method for the useway property.
*
* @return the current value of the useway property
*/
public String getUseway()
{
return useway;
}
/**
* Sets the value of the useway property.
*
* @param aUseway the new value of the useway property
*/
public void setUseway(String aUseway)
{
useway = setChnString(aUseway);
}
/**
* Access method for the documentId property.
*
* @return the current value of the documentId property
*/
public String getDocumentId()
{
return documentId;
}
/**
* Sets the value of the documentId property.
*
* @param aDocumentId the new value of the documentId property
*/
public void setDocumentId(String aDocumentId)
{
documentId = setChnString(aDocumentId);
}
public int loadAttr()
{
try {
contractId = getRsString(rs,"contractId");
protocolId = getRsString(rs, "protocolId");
bank = getRsString(rs,"bank");
creditBank = getRsString(rs,"creditBank");
bankMoney = rs.getFloat("bankMoney");
creditMoney = rs.getFloat("creditMoney");
dateType = rs.getInt("dateType");
useway = getRsString(rs,"useway");
documentId = getRsString(rs,"documentId");
}
catch(SQLException e)
{
e.printStackTrace();
System.out.println("query failed!");
return -1;
}
return 1;
}
public int insert()
{
String sql= "INSERT INTO CreditDoc " +
"(contractId,protocolId,bank,creditBank,bankMoney,creditMoney," +
"dateType,useway,documentId) " +
"VALUES ('"+getContractId()+"','"+getProtocolId()+"','"+getBank()+
"','"+getCreditBank()+"',"+getBankMoney()+","+getCreditMoney()+
","+getDateType()+",'"+getUseway()+"','"+getDocumentId()+"')";
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 CreditDoc SET contractId='"+getContractId()+"',bank='"
+getBank()+"',creditBank='"+getCreditBank()+"',bankMoney="
+getBankMoney()+",creditMoney="+getCreditMoney()+",dateType="
+getDateType()+",useway='"+getUseway()+"',documentId='"
+getDocumentId()+"' "+
"WHERE protocolId='" + getProtocolId() + "'";
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, "protocolId", "=", "'", request.getParameter("protocolId"));
break;
case 2:
break;
}
return whereClause;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -