Пример #1
0
        public int Insert(GovPublicApplyInfo info)
        {
            int applyId;

            info.BeforeExecuteNonQuery();
            IDataParameter[] parms;
            var sqlInsert = BaiRongDataProvider.TableStructureDao.GetInsertSqlString(info.Attributes, TableName, out parms);

            using (var conn = GetConnection())
            {
                conn.Open();
                using (var trans = conn.BeginTransaction())
                {
                    try
                    {
                        applyId = ExecuteNonQueryAndReturnId(trans, sqlInsert, parms);
                        trans.Commit();
                    }
                    catch
                    {
                        trans.Rollback();
                        throw;
                    }
                }
            }

            return(applyId);
        }
Пример #2
0
        public void Update(GovPublicApplyInfo info)
        {
            info.BeforeExecuteNonQuery();
            IDataParameter[] parms;
            var sqlUpdate = BaiRongDataProvider.TableStructureDao.GetUpdateSqlString(info.Attributes, TableName, out parms);

            ExecuteNonQuery(sqlUpdate, parms);
        }