示例#1
0
        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);
            }
        }
示例#2
0
 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);
 }
示例#3
0
 public bool add(SqlConnection cn, SqlTransaction tc, PayRecordModel model)
 {
     return DbHelperSQL.insertModel<PayRecordModel>(model, "PayRecord", cn, tc);
 }