本文整理汇总了C#中WhereSqlClauseBuilder.AppendTenantCodeSqlClause方法的典型用法代码示例。如果您正苦于以下问题:C# WhereSqlClauseBuilder.AppendTenantCodeSqlClause方法的具体用法?C# WhereSqlClauseBuilder.AppendTenantCodeSqlClause怎么用?C# WhereSqlClauseBuilder.AppendTenantCodeSqlClause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhereSqlClauseBuilder
的用法示例。
在下文中一共展示了WhereSqlClauseBuilder.AppendTenantCodeSqlClause方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
/// <summary>
/// 返回流程所有的已流转过的活动节点
/// </summary>
/// <param name="processID"></param>
/// <returns></returns>
public WfProcessCurrentActivityCollection Load(string processID)
{
processID.CheckStringIsNullOrEmpty(processID);
WfProcessCurrentActivityCollection result = new WfProcessCurrentActivityCollection();
WhereSqlClauseBuilder wBuilder = new WhereSqlClauseBuilder();
wBuilder.AppendItem("PROCESS_ID", processID);
wBuilder.AppendTenantCodeSqlClause(typeof(WfProcessCurrentActivity));
string sql = string.Format("SELECT * FROM WF.PROCESS_CURRENT_ACTIVITIES WHERE {0}",
wBuilder.ToSqlString(TSqlBuilder.Instance));
DataTable table = DbHelper.RunSqlReturnDS(sql, GetConnectionName()).Tables[0];
result.LoadFromDataView(table.DefaultView);
return result;
}
示例2: Update
public void Update(string processID, WfProcessCurrentActivityCollection pcas)
{
processID.CheckStringIsNullOrEmpty("processID");
pcas.NullCheck("pcas");
StringBuilder strB = new StringBuilder();
InSqlClauseBuilder deleteActivityIDs = new InSqlClauseBuilder("ACTIVITY_ID");
foreach (WfProcessCurrentActivity pca in pcas)
{
if (strB.Length > 0)
strB.Append(TSqlBuilder.Instance.DBStatementSeperator);
strB.Append(ORMapping.GetInsertSql(pca, TSqlBuilder.Instance));
deleteActivityIDs.AppendItem(pca.ActivityID);
}
WhereSqlClauseBuilder wBuilder = new WhereSqlClauseBuilder();
wBuilder.AppendItem("PROCESS_ID", processID);
wBuilder.AppendTenantCodeSqlClause(typeof(WfProcessCurrentActivity));
string sqlDelete = string.Format("DELETE WF.PROCESS_CURRENT_ACTIVITIES WHERE {0}",
wBuilder.ToSqlString(TSqlBuilder.Instance));
if (deleteActivityIDs.Count > 0)
sqlDelete += string.Format(" AND {0}", deleteActivityIDs.ToSqlString(TSqlBuilder.Instance));
string sql = sqlDelete;
if (strB.Length > 0)
sql += TSqlBuilder.Instance.DBStatementSeperator + strB.ToString();
DbHelper.RunSqlWithTransaction(sql, GetConnectionName());
}