public ModelInvokeResult <SetSolutionPK> Delete(string strSolutionId) { ModelInvokeResult <SetSolutionPK> result = new ModelInvokeResult <SetSolutionPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string _SolutionId = strSolutionId; SetSolutionPK pk = new SetSolutionPK { SolutionId = _SolutionId }; DeleteCascade(statements, pk); statements.Add(new IBatisNetBatchStatement { StatementName = new SetSolution().GetDeleteMethodName(), ParameterObject = pk, Type = SqlExecuteType.DELETE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new SetSolutionPK { SolutionId = _SolutionId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public InvokeResult DeleteSelected(string strSolutionIds) { InvokeResult result = new InvokeResult { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string[] arrSolutionIds = strSolutionIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (arrSolutionIds.Length == 0) { result.Success = false; result.ErrorCode = 59996; return(result); } string statementName = new SetSolution().GetDeleteMethodName(); foreach (string strSolutionId in arrSolutionIds) { SetSolutionPK pk = new SetSolutionPK { SolutionId = strSolutionId }; DeleteCascade(statements, pk); statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = pk, Type = SqlExecuteType.DELETE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
private void DeleteCascade(List <IBatisNetBatchStatement> statements, SetSolutionPK pk) { //此处增加级联删除代码 }