public int Insert(CardSignLogInfo cardSignLogInfo) { var cardSignLogId = 0; IDataParameter[] parms = null; var sqlInsert = BaiRongDataProvider.TableStructureDao.GetInsertSqlString(cardSignLogInfo.ToNameValueCollection(), ConnectionString, TableName, out parms); using (var conn = GetConnection()) { conn.Open(); using (var trans = conn.BeginTransaction()) { try { cardSignLogId = ExecuteNonQueryAndReturnId(trans, sqlInsert, parms); trans.Commit(); } catch { trans.Rollback(); throw; } } } return(cardSignLogId); }
public void Update(CardSignLogInfo cardSignLogInfo) { IDataParameter[] parms = null; var sqlUpdate = BaiRongDataProvider.TableStructureDao.GetUpdateSqlString(cardSignLogInfo.ToNameValueCollection(), ConnectionString, TableName, out parms); ExecuteNonQuery(sqlUpdate, parms); }
public int Insert(CardSignLogInfo cardSignLogInfo) { var cardSignLogID = 0; IDataParameter[] parms = null; var SQL_INSERT = BaiRongDataProvider.TableStructureDao.GetInsertSqlString(cardSignLogInfo.ToNameValueCollection(), ConnectionString, TABLE_NAME, out parms); using (var conn = GetConnection()) { conn.Open(); using (var trans = conn.BeginTransaction()) { try { ExecuteNonQuery(trans, SQL_INSERT, parms); cardSignLogID = BaiRongDataProvider.DatabaseDao.GetSequence(trans, TABLE_NAME); trans.Commit(); } catch { trans.Rollback(); throw; } } } return(cardSignLogID); }