📄 stockinfotra.java
字号:
//Source file: D:\work\五洋\javaBean\src\LocationState.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class StockInfoTra extends ShangObject
{
/**
凭证编号
*/
private String receiptId;
/**
凭证类型
*/
private int receiptType;
/**
状态
*/
private int state;
public StockInfoTra()
{
primarykey1Name = "receiptId";
primarykey1Type = 1;
primarykey2Name = "receiptType";
primarykey2Type = 0;
tableName = "StockInfoTra";
viewName = "StockInfoTra";
numInOnePager = 1;
}
public int loadAttr(){
try{
receiptId = getRsString(rs,"receiptId");
receiptType = rs.getInt("receiptType");
state = rs.getInt("state");
return 1;
}catch(SQLException e){
e.printStackTrace();
System.out.println("query failed");
return -1;
}
}
/* 新增
@loginName varchar(30)
,@ip varchar(20)
,@machineName varchar(30)
,@receiptId varchar(10)
,@receiptType int
,@stae int
*/
public int insert() {
String sql= "{?=call sp_InsertStockInfoTra(?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
setStmtString(updStmt,5,receiptId);
updStmt.setInt(6,receiptType);
updStmt.setInt(7,state);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
/* 新增
@loginName varchar(30)
,@ip varchar(20)
,@machineName varchar(30)
,@receiptId varchar(10)
,@receiptType int
,@stae int
*/
public int update() {
String sql= "{?=call sp_UpdateStockInfoTra(?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
setStmtString(updStmt,5,receiptId);
updStmt.setInt(6,receiptType);
updStmt.setInt(7,state);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
/**
* Access method for the receiptId property.
*
* @return the current value of the receiptId property
*/
public String getReceiptId()
{
return receiptId;
}
/**
* Sets the value of the receiptId property.
*
* @param aLocationId the new value of the receiptId property
*/
public void setReceiptId(String aReceiptId)
{
receiptId = setChnString(aReceiptId);
}
/**
* Access method for the receiptType property.
*
* @return the current value of the receiptType property
*/
public int getReceiptType()
{
return receiptType;
}
/**
* Sets the value of the receiptType property.
*
* @param aProductId the new value of the receiptType property
*/
public void setProductId(int aReceiptType)
{
receiptType = aReceiptType;
}
/**
* Access method for the state property.
*
* @return the current value of the state property
*/
public int getState()
{
return state;
}
/**
* Sets the value of the state property.
*
* @param aProductId the new value of the state property
*/
public void setState(int aState)
{
state = aState;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -