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