public void add(DbUpdateModel dbupdate) { SqlConnection cn = null; SqlTransaction tc = null; try { cn = DbHelperSQL.getConnection(); tc = DbHelperSQL.startTransaction(cn); //执行新增写进数据库 dbupdateDal.add(cn, tc, dbupdate); 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, DbUpdateModel model) { return DbHelperSQL.updateModel<DbUpdateModel>(model, "DbUpdate", "TableName", model.TableName, "'", cn, tc); }
public bool add(SqlConnection cn, SqlTransaction tc, DbUpdateModel model) { return DbHelperSQL.insertModel<DbUpdateModel>(model, "DbUpdate", cn, tc); }