Пример #1
0
        public ModelInvokeResult <Ewallet_OldManPK> Update(string strOldManId, Ewallet_OldMan ewallet)
        {
            ModelInvokeResult <Ewallet_OldManPK> result = new ModelInvokeResult <Ewallet_OldManPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_OldManId = strOldManId.ToGuid();
                if (_OldManId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                ewallet.OldManId = _OldManId;
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = ewallet.GetUpdateMethodName(), ParameterObject = ewallet.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new Ewallet_OldManPK {
                    OldManId = _OldManId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #2
0
        public InvokeResult NullifySelected(string strOldManIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrOldManIds = strOldManIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrOldManIds.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new Ewallet_OldMan().GetUpdateMethodName();
                foreach (string strOldManId in arrOldManIds)
                {
                    Ewallet_OldMan ewallet = new Ewallet_OldMan {
                        OldManId = strOldManId.ToGuid(), Status = 0
                    };
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = ewallet.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #3
0
        public ModelInvokeResult <Ewallet_OldManPK> Create(Ewallet_OldMan ewallet)
        {
            ModelInvokeResult <Ewallet_OldManPK> result = new ModelInvokeResult <Ewallet_OldManPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (ewallet.OldManId == GlobalManager.GuidAsAutoGenerate)
                {
                    ewallet.OldManId = Guid.NewGuid();
                }
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = ewallet.GetCreateMethodName(), ParameterObject = ewallet.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new Ewallet_OldManPK {
                    OldManId = ewallet.OldManId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }