public InvokeResult NullifySelected(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().GetUpdateMethodName(); foreach (string strSolutionId in arrSolutionIds) { SetSolution setSolution = new SetSolution { SolutionId = strSolutionId, Status = 0 }; /***********************begin 自定义代码*******************/ setSolution.OperatedBy = NormalSession.UserId.ToGuid(); setSolution.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = setSolution.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public ModelInvokeResult <SetSolutionPK> Nullify(string strSolutionId) { ModelInvokeResult <SetSolutionPK> result = new ModelInvokeResult <SetSolutionPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); string _SolutionId = strSolutionId; SetSolution setSolution = new SetSolution { SolutionId = _SolutionId, Status = 0 }; /***********************begin 自定义代码*******************/ setSolution.OperatedBy = NormalSession.UserId.ToGuid(); setSolution.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = setSolution.GetUpdateMethodName(), ParameterObject = setSolution.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************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 ModelInvokeResult <SetSolutionPK> Create(SetSolution setSolution) { ModelInvokeResult <SetSolutionPK> result = new ModelInvokeResult <SetSolutionPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); if (setSolution.SolutionId == "自动生成") { setSolution.SolutionId = GlobalManager.getPK(setSolution.GetMappingTableName(), "SolutionId"); } /***********************begin 自定义代码*******************/ setSolution.OperatedBy = NormalSession.UserId.ToGuid(); setSolution.OperatedOn = DateTime.Now; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = setSolution.GetCreateMethodName(), ParameterObject = setSolution.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new SetSolutionPK { SolutionId = setSolution.SolutionId }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }