groovy:確認功能
Callout
============
import java.sql.Timestamp
import java.math.BigDecimal
import java.sql.PreparedStatement
import java.sql.ResultSet
import org.compiere.util.DB
import org.compiere.model.MUser
import org.compiere.util.Env
if (A_Value != null )
{
int id = ((Integer) A_Value).intValue();
String sql ="SELECT \"狀態\" FROM \"確認\" WHERE \"確認_id\"=? ";
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, id);
ResultSet rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.getString("狀態") != null) A_Tab.setValue("狀態",rs. getString ("狀態"));
if (id==1000000 )
{
int id1 =Env.getContextAsInt(A_Ctx, "#AD_User_ID");
A_Tab.setValue("確認者_ID", new Integer(id1) );
}
if (id==1000001 )
{
A_Tab.setValue("確認者_ID", null );
}
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言