}
public override int Insert(string sqlStr, CommandType cmdType, List<DbParameter> listParams)
{
object obj = ExecuteScalar(sqlStr, cmdType, listParams);
int id = obj == null ? 0 : int.Parse(obj.ToString());
return id;
}
/// <summary>
/// 批量插入
/// </summary>
/// <param name="tableName"></param>
/// <param name="batchSize"></param>
/// <param name="copyTimeout"></param>
/// <param name="dt"></param>
/// <returns></returns>
public override bool BatchInsert(string tableName, int batchSize, int copyTimeout, DataTable dt)
{
return this.CurrentDbOperation.ExecuteBatchInsert(tableName, batchSize, copyTimeout, dt);
}
#endregion
#region delete
public override int Delete(string sqlStr)
{
return CommitSql(sqlStr, CommandType.Text, null);
}
public override int Delete(string sqlStr, CommandType cmdType, List<DbParameter> listParams)
{
return CommitSql(sqlStr, cmdType, listParams);
}
#endregion
#region update
public override int Update(string sqlStr)
{
return CommitSql(sqlStr, CommandType.Text, null);
}
public override int Update(string sqlStr, CommandType cmdType, List<DbParameter> listParams)
{
return CommitSql(sqlStr, cmdType, listParams);
}
#endregion
#region commit and execute sql
private int CommitSql(string sqlStr, CommandType cmdType, List<DbParameter> listParams)
{
return this.CurrentDbOperation.ExecuteNonQuery(sqlStr, cmdType, listParams);
}
#endregion
#region dbparameter
public DbParameter CreateParameter(string paraName, object paramValue)
{
return this.CurrentDbOperation.CreateDbPrameter(paraName, paramValue);
}
public List<DbParameter> CreateParameterList(string[] paraNames, object[] paramValues)
{
List<DbParameter> listParams = new List<DbParameter>();
try
{
if (paraNames.Length != paramValues.Length)
12/13 首页 上一页 10 11 12 13 下一页 尾页 |