public void add(PayRecordModel payrecord) { SqlConnection cn = null; SqlTransaction tc = null; try { cn = DbHelperSQL.getConnection(); tc = DbHelperSQL.startTransaction(cn); //执行新增写进数据库 payrecordDal.add(cn, tc, payrecord); DbHelperSQL.commitTransaction(tc); } catch (Exception dalEx) { DbHelperSQL.rollBackTransaction(tc); throw new MakeException(ExpSort.数据库, dalEx.Message); } finally { DbHelperSQL.closeConnection(cn); } }
public bool update(SqlConnection cn, SqlTransaction tc, PayRecordModel model) { return DbHelperSQL.updateModel<PayRecordModel>(model, "PayRecord", "CA_ND + '|' + SchoolNo", model.CA_ND + "|" + model.SchoolNo, "'", cn, tc); }
public bool add(SqlConnection cn, SqlTransaction tc, PayRecordModel model) { return DbHelperSQL.insertModel<PayRecordModel>(model, "PayRecord", cn, tc); }