public void DeleteAllSubTable_FB( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); save(dataDom, sessionInfo, serviceRequest); serviceRequest.getMessage().clear(); pk = table.getPkValue(); if ((pk != null) && (!"".equals(pk))) { db.execSqlUpdate("delete from YXPRJLIN where IS_FB='Y' and PRJ_NO = " + pk); } db.commit(); WhereLimit wr = new WhereLimit(); wr.addColumn(new Column("PRJ_NO", pk)); dataDom.getTable("YXPRJLIN").setWhereLimit(wr); dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo); } catch (Exception ex) { if (db != null) { db.rollback(); } Log.error(ex); } finally { if (db != null) { db.cleanup(); } } }
public void clearDLFL_AMT(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); save(dataDom, sessionInfo, serviceRequest); serviceRequest.getMessage().clear(); pk = table.getPkValue(); db.execSqlUpdate("update YXPRJLIN set DLFL_AMT='' where PRJ_NO = " + pk); db.commit(); pk = table.getPkValue(); WhereLimit wr = new WhereLimit(); wr.addColumn(new Column("PRJ_NO", pk)); dataDom.getTable("YXPRJLIN").setWhereLimit(wr); dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo); } catch (Exception ex) { db.rollback(); Log.error(ex); } finally { if (db != null) { db.cleanup(); } } }
public boolean deleteChildTable( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest, Database db) throws LiemsException { try { if ((dataDom.getRootTable().getPkValue() != null) && (!"".equals(dataDom.getRootTable().getPkValue()))) { String sql = "delete from YXPRJLIN where PRL_NO=" + dataDom.getRootTable().getPkValue(); String sql2 = "delete from YXDOCMST where PRJ_NO=" + dataDom.getRootTable().getPkValue(); db.execSqlUpdate(sql); db.execSqlUpdate(sql2); } } catch (Exception e) { e.printStackTrace(); } return true; }
public static String deletedata(String params, HttpServletRequest request) throws Exception { Database db = null; try { db = Tools.getDatabase(true); String sql = "delete from WFTESTMST where CLIENTIP = '" + request.getRemoteAddr() + "'"; db.execSqlUpdate(sql); } catch (SQLException se) { Log.error(se.getMessage()); return "删除失败"; } finally { if (db != null) { db.cleanup(); } } return "删除成功"; }
public boolean deleteChildTable( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest, Database db) throws LiemsException { try { String sql = "delete from " + dataDom.getChildTable().getName() + " where " + dataDom.getRootTable().getPkFieldName() + "=" + dataDom.getRootTable().getPkValue(); db.execSqlUpdate(sql); } catch (Exception e) { e.printStackTrace(); } return true; }
public void DeleteAllSubTable( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); save(dataDom, sessionInfo, serviceRequest); serviceRequest.getMessage().clear(); pk = table.getPkValue(); db.execSqlUpdate("delete from YXPRJLIN where PRJ_NO = " + pk); db.commit(); } catch (Exception ex) { db.rollback(); Log.error(ex); } finally { if (db != null) { db.cleanup(); } } setFirstRowSubTable(dataDom, sessionInfo, serviceRequest); }
private void initTBRTable(DataDom dataDom, String prjNo, Database db) throws Exception { String sql1 = "select PRJL_NO from YXPRJLIN where PRJ_NO = " + prjNo; String unit = getMonUnit(prjNo); Rowset rs = db.getRS(sql1); CommSequence seq = CommSequence.getInstance("YXDBJYLIN_SEQ"); while (rs.next()) { String prjlNo = Charset.nullToEmpty(rs.getString("PRJL_NO")); String sql = "insert into YXDBJYLIN(DBJYL_NO,PRJL_NO,PRJ_NO,IS_NTC,IS_RCV,MON_UNIT)values(" + seq.getNextValue() + "," + prjlNo + "," + Charset.nullToEmpty(prjNo) + "," + "'N', 'N'," + unit + ")"; db.execSqlUpdate(sql); } }
public void setFirstRowSubTable( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { String ZB_ID = serviceRequest.getParameter("ZB_ID"); String PRJ_NAM = serviceRequest.getParameter("PRJ_NAM"); Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); pk = table.getPkValue(); String nextPkValue = CommSequence.getInstance("YXPRJLIN_SEQ").getNextValue(); db.execSqlUpdate( "insert into YXPRJLIN(PRJL_NO,PRJ_NO,PRJL_ID,PRJL_NAM,IS_FB) values( " + nextPkValue + "," + pk + ",'" + ZB_ID + "','" + PRJ_NAM + "','Y') "); db.commit(); pk = table.getPkValue(); WhereLimit wr = new WhereLimit(); wr.addColumn(new Column("PRJ_NO", pk)); dataDom.getTable("YXPRJLIN").setWhereLimit(wr); dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo); } catch (Exception ex) { db.rollback(); Log.error(ex); } finally { if (db != null) { db.cleanup(); } } }