Exemple #1
0
        public ModelInvokeResult <EPay_AssessPackagePK> Nullify(string strId)
        {
            ModelInvokeResult <EPay_AssessPackagePK> result = new ModelInvokeResult <EPay_AssessPackagePK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                EPay_AssessPackage             ePay       = new EPay_AssessPackage {
                    Id = Convert.ToInt32(strId), Status = 0
                };
                /***********************begin 自定义代码*******************/
                ePay.OperatedBy = NormalSession.UserId.ToGuid();
                ePay.OperatedOn = DateTime.Now;
                ePay.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = ePay.GetUpdateMethodName(), ParameterObject = ePay.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new EPay_AssessPackagePK {
                    Id = ePay.Id
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Exemple #2
0
        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 EPay_AssessPackage().GetUpdateMethodName();
                foreach (string strId in arrIds)
                {
                    EPay_AssessPackage ePay = new EPay_AssessPackage {
                        Id = Convert.ToInt32(strId), Status = 0
                    };
                    /***********************begin 自定义代码*******************/
                    ePay.OperatedBy = NormalSession.UserId.ToGuid();
                    ePay.OperatedOn = DateTime.Now;
                    ePay.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                    /***********************end 自定义代码*********************/
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = ePay.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                    });
                }
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Exemple #3
0
        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 EPay_AssessPackage().GetDeleteMethodName();
                foreach (string strId in arrIds)
                {
                    EPay_AssessPackagePK pk = new EPay_AssessPackagePK {
                        Id = Convert.ToInt32(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);
        }