public ModelInvokeResult <MerchantServeManMappingOldManPK> Nullify(string strId) { ModelInvokeResult <MerchantServeManMappingOldManPK> result = new ModelInvokeResult <MerchantServeManMappingOldManPK> { Success = true }; try { List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>(); MerchantServeManMappingOldMan merchantServeManMappingOldMan = new MerchantServeManMappingOldMan { Id = int.Parse(strId) }; /***********************begin 自定义代码*******************/ merchantServeManMappingOldMan.OperatedBy = NormalSession.UserId.ToGuid(); merchantServeManMappingOldMan.OperatedOn = DateTime.Now; merchantServeManMappingOldMan.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = merchantServeManMappingOldMan.GetUpdateMethodName(), ParameterObject = merchantServeManMappingOldMan.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); /***********************begin 自定义代码*******************/ /***********************此处添加自定义代码*****************/ /***********************end 自定义代码*********************/ BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); result.instance = new MerchantServeManMappingOldManPK { Id = int.Parse(strId) }; } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
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 MerchantServeManMappingOldMan().GetUpdateMethodName(); foreach (string strId in arrIds) { MerchantServeManMappingOldMan merchantServeManMappingOldMan = new MerchantServeManMappingOldMan { Id = int.Parse(strId) }; /***********************begin 自定义代码*******************/ merchantServeManMappingOldMan.OperatedBy = NormalSession.UserId.ToGuid(); merchantServeManMappingOldMan.OperatedOn = DateTime.Now; merchantServeManMappingOldMan.DataSource = GlobalManager.DIKey_00012_ManualEdit; /***********************end 自定义代码*********************/ statements.Add(new IBatisNetBatchStatement { StatementName = statementName, ParameterObject = merchantServeManMappingOldMan.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE }); } BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements); } catch (Exception ex) { result.Success = false; result.ErrorMessage = ex.Message; } return(result); }
public InvokeResult DeleteSelected(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 MerchantServeManMappingOldMan().GetDeleteMethodName(); foreach (string strId in arrIds) { MerchantServeManMappingOldManPK pk = new MerchantServeManMappingOldManPK { Id = int.Parse(strId) }; 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); }