?? feecost.java
字號:
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class FeeCost extends ShangObject
{
/**
開票單編碼
*/
private String slipId;
/**
費用編碼
*/
private int feeId;
/**
費用名稱
*/
private String feeName;
/**
費用金額
*/
private float feeMoney;
/**
個人編碼
*/
private String proposer;
/**
部門編碼
*/
private String deptId;
/**
時間
*/
private Timestamp feeDate;
public FeeCost()
{
primarykey1Name = "slipId";
primarykey1Type = 1;
primarykey2Name = "feeId";
primarykey2Type = 0;
tableName = "FeeCost";
viewName = "v_FeeCost";
numInOnePager = 10;
}
public int loadAttr(){
try{
slipId = getRsString(rs,"slipId");
feeId = rs.getInt("feeId");
feeName = getRsString(rs,"feeName");
feeMoney = rs.getFloat("feeMoney");
proposer = getRsString(rs,"proposer");
deptId = getRsString(rs,"deptId");
feeDate = rs.getTimestamp("feeDate");
} catch(SQLException e) {
e.printStackTrace();
System.out.println("query failed!");
return -1;
}
return 1;
}
public int insert(){
String sql= "insert into FeeCost (slipId,feeId,feeMoney) values (?,?,?)";
try{
PreparedStatement updStmt = conn.prepareStatement(sql);
setStmtString(updStmt, 1, slipId);
updStmt.setInt(2, feeId);
updStmt.setFloat(3,feeMoney);
updStmt.executeUpdate();
updStmt.close();
return 1;
}catch(SQLException e){
System.out.println(e.getMessage());
e.printStackTrace();
return -1;
}
}
public int update(){
String sql = "update FeeCost set feeMoney=? where slipId='"
+ slipId + "' and feeId =" + feeId;
try{
PreparedStatement updStmt = conn.prepareStatement(sql);
updStmt.setFloat(1,feeMoney);
print("sql== " + sql );
updStmt.executeUpdate();
updStmt.close();
return 0;
}catch(SQLException e){
System.out.println(e.getMessage());
e.printStackTrace();
return -1;
}
}
/**
* Access method for the accountId property.
*
* @return the current value of the accountId property
*/
public String getSlipId()
{
return slipId;
}
/**
* Sets the value of the accountId property.
*
* @param aAccountId the new value of the accountId property
*/
public void setSlipId(String aSlipId)
{
slipId = setChnString(aSlipId);
}
/**
* Access method for the feeName property.
*
* @return the current value of the feeName property
*/
public int getFeeId()
{
return feeId;
}
/**
* Sets the value of the feeName property.
*
* @param afeeName the new value of the feeName property
*/
public void setFeeId(int aFeeId)
{
feeId = aFeeId;
}
/**
* Access method for the feeMoney property.
*
* @return the current value of the feeMoney property
*/
public float getFeeMoney()
{
return feeMoney;
}
/**
* Sets the value of the feeMoney property.
*
* @param aFeeMoney the new value of the feeMoney property
*/
public void setFeeMoney(float aFeeMoney)
{
feeMoney = aFeeMoney;
}
/**
* Access method for the feeName property.
*
* @return the current value of the feeName property
*/
public String getFeeName()
{
return feeName;
}
/**
* Sets the value of the feeName property.
*
* @param aFeeName the new value of the feeName property
*/
public void setFeeName(String aFeeName)
{
feeName = setChnString(aFeeName);
}
/**
* Access method for the proposer property.
*
* @return the current value of the proposer property
*/
public String getProposer()
{
return proposer;
}
/**
* Sets the value of the proposer property.
*
* @param aProposer the new value of the proposer property
*/
public void setProposer(String aProposer)
{
proposer = setChnString(aProposer);
}
/**
* Access method for the deptId property.
*
* @return the current value of the deptId property
*/
public String getDeptId()
{
return deptId;
}
/**
* Sets the value of the deptId property.
*
* @param aDeptId the new value of the deptId property
*/
public void setDeptId(String aDeptId)
{
deptId = setChnString(aDeptId);
}
public Timestamp getFeeDate() {
return feeDate;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -