Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public bool update(SqlConnection cn, SqlTransaction tc, DbUpdateModel model)
 {
     return DbHelperSQL.updateModel<DbUpdateModel>(model, "DbUpdate", "TableName", model.TableName, "'", cn, tc);
 }
Esempio n. 3
0
 public bool add(SqlConnection cn, SqlTransaction tc, DbUpdateModel model)
 {
     return DbHelperSQL.insertModel<DbUpdateModel>(model, "DbUpdate", cn, tc);
 }