本文整理汇总了C#中IDbHelper.MakeParameter方法的典型用法代码示例。如果您正苦于以下问题:C# IDbHelper.MakeParameter方法的具体用法?C# IDbHelper.MakeParameter怎么用?C# IDbHelper.MakeParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDbHelper
的用法示例。
在下文中一共展示了IDbHelper.MakeParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsModifed
/// <summary>
/// 数据是否已经被别人修改了
/// </summary>
/// <param name="dbHelper">数据库连接</param>
/// <param name="tableName">表名</param>
/// <param name="id">主键</param>
/// <param name="fieldName">字段</param>
/// <param name="fieldValue">值</param>
/// <param name="oldModifiedUserId">最后修改者</param>
/// <param name="oldModifiedOn">最后修改时间</param>
/// <returns>已被修改</returns>
public static bool IsModifed(IDbHelper dbHelper, string tableName, string fieldName, Object fieldValue, string oldModifiedUserId, DateTime? oldModifiedOn)
{
bool returnValue = false;
string sqlQuery = " SELECT " + BaseBusinessLogic.FieldId
+ "," + BaseBusinessLogic.FieldCreateUserId
+ "," + BaseBusinessLogic.FieldCreateOn
+ "," + BaseBusinessLogic.FieldModifiedUserId
+ "," + BaseBusinessLogic.FieldModifiedOn
+ " FROM " + tableName
+ " WHERE " + fieldName + " = " + dbHelper.GetParameter(fieldName);
DataTable dataTable = dbHelper.Fill(sqlQuery, new IDbDataParameter[] { dbHelper.MakeParameter(fieldName, fieldValue)});
returnValue = IsModifed(dataTable, oldModifiedUserId, oldModifiedOn);
return returnValue;
}