コード例 #1
0
        public ModelInvokeResult <WhiteListPK> Update(string strId, WhiteList whiteList)
        {
            ModelInvokeResult <WhiteListPK> result = new ModelInvokeResult <WhiteListPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();

                whiteList.Id = int.Parse(strId);

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