コード例 #1
0
        public ModelInvokeResult <ServiceCallBackPK> Nullify(string strCallBackId)
        {
            ModelInvokeResult <ServiceCallBackPK> result = new ModelInvokeResult <ServiceCallBackPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_CallBackId = strCallBackId.ToGuid();
                if (_CallBackId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                ServiceCallBack serviceCallBack = new ServiceCallBack {
                    CallBackId = _CallBackId, Status = 0
                };
                /***********************begin 自定义代码*******************/
                serviceCallBack.OperatedBy = NormalSession.UserId.ToGuid();
                serviceCallBack.OperatedOn = DateTime.Now;
                serviceCallBack.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = serviceCallBack.GetUpdateMethodName(), ParameterObject = serviceCallBack.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ServiceCallBackPK {
                    CallBackId = _CallBackId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
コード例 #2
0
        public InvokeResult NullifySelected(string strCallBackIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrCallBackIds = strCallBackIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrCallBackIds.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new ServiceCallBack().GetUpdateMethodName();
                foreach (string strCallBackId in arrCallBackIds)
                {
                    ServiceCallBack serviceCallBack = new ServiceCallBack {
                        CallBackId = strCallBackId.ToGuid(), Status = 0
                    };
                    /***********************begin 自定义代码*******************/
                    serviceCallBack.OperatedBy = NormalSession.UserId.ToGuid();
                    serviceCallBack.OperatedOn = DateTime.Now;
                    serviceCallBack.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                    /***********************end 自定义代码*********************/
                    statements.Add(new IBatisNetBatchStatement {
                        StatementName = statementName, ParameterObject = serviceCallBack.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 <ServiceCallBackPK> CreateByNoOperator(ServiceCallBack serviceCallBack)
        {
            ModelInvokeResult <ServiceCallBackPK> result = new ModelInvokeResult <ServiceCallBackPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (serviceCallBack.CallBackId == GlobalManager.GuidAsAutoGenerate)
                {
                    serviceCallBack.CallBackId = Guid.NewGuid();
                }
                /***********************begin 自定义代码*******************/
                //serviceCallBack.OperatedBy = NormalSession.UserId.ToGuid();
                //serviceCallBack.OperatedOn = DateTime.Now;
                serviceCallBack.DataSource = GlobalManager.DIKey_00012_ManualEdit;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = serviceCallBack.GetCreateMethodName(), ParameterObject = serviceCallBack.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new ServiceCallBackPK {
                    CallBackId = serviceCallBack.CallBackId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
コード例 #4
0
        public InvokeResult DeleteSelected(string strCallBackIds)
        {
            InvokeResult result = new InvokeResult {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                string[] arrCallBackIds = strCallBackIds.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (arrCallBackIds.Length == 0)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                string statementName = new ServiceCallBack().GetDeleteMethodName();
                foreach (string strCallBackId in arrCallBackIds)
                {
                    ServiceCallBackPK pk = new ServiceCallBackPK {
                        CallBackId = strCallBackId.ToGuid()
                    };
                    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);
        }
コード例 #5
0
        /// <summary>
        /// This is the default constructor.
        /// </summary>
        /// <param name="delInternalStart"></param>
        /// <param name="delInternalStop"></param>
        /// <param name="delInternalPause"></param>
        /// <param name="delInternalContinue"></param>
        public XimuraComponentServiceHelper(object rootClass, ServiceCallBack delInternalStart, ServiceCallBack delInternalStop,
            ServiceCallBack delInternalPause, ServiceCallBack delInternalContinue)
        {
            this.rootClass = rootClass;
            this.delInternalStart = delInternalStart;
            this.delInternalStop = delInternalStop;
            this.delInternalPause = delInternalPause;
            this.delInternalContinue = delInternalContinue;

            mNotifyAfter = null;
            mNotifyBefore = null;

        }