public InvokeResult NullifySelected(string strIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrIds = strIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrIds.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new FlowDefineMapping().GetUpdateMethodName(); foreach (string strId in arrIds) { FlowDefineMapping flowDefineMapping = new FlowDefineMapping { Id = int.Parse(strId), Status = 0 }; /***********************begin 自定义代码*******************/ flowDefineMapping.OperatedBy = NormalSession.UserId.ToGuid(); flowDefineMapping.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = flowDefineMapping.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); } BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <FlowDefineMappingPK> Nullify(string strId) { ModelInvokeResult <FlowDefineMappingPK> result = new ModelInvokeResult <FlowDefineMappingPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); FlowDefineMapping flowDefineMapping = new FlowDefineMapping { Id = int.Parse(strId), Status = 0 }; /***********************begin 自定义代码*******************/ flowDefineMapping.OperatedBy = NormalSession.UserId.ToGuid(); flowDefineMapping.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = flowDefineMapping.GetUpdateMethodName(), ParameterObject = flowDefineMapping.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder(GetHttpHeader("ConnectId")).ExecuteNativeSqlNoneQuery(statements); result.instance = new FlowDefineMappingPK { Id = int.Parse(strId) }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }