コード例 #1
0
        public InvokeResult NullifySelected(string strAccountCodes)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrAccountCodes = strAccountCodes.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrAccountCodes.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new ServiceAccount().GetUpdateMethodName();
                foreach (string strAccountCode in arrAccountCodes)
                {
                    ServiceAccount serviceAccount = new ServiceAccount {
                        AccountCode = strAccountCode, Status = 0
                    };
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = serviceAccount.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
コード例 #2
0
        public ModelInvokeResult <ServiceAccountPK> Nullify(string strAccountCode)
        {
            ModelInvokeResult <ServiceAccountPK> result = new ModelInvokeResult <ServiceAccountPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string         _AccountCode   = strAccountCode;
                ServiceAccount serviceAccount = new ServiceAccount {
                    AccountCode = _AccountCode, Status = 0
                };

                statements.Add(new IBatisNetBatchStatement {
                    StatementName = serviceAccount.GetUpdateMethodName(), ParameterObject = serviceAccount.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ServiceAccountPK {
                    AccountCode = _AccountCode
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }