Beispiel #1
0
        internal bool UpdateStatus(string code, FailMqMessageStatus status, int count = 0)
        {
            DataCenterHelper dataCenter = new DataCenterHelper();
            var paramList = new List <SqlParameter> {
                new SqlParameter()
                {
                    ParameterName = "@status", Value = (int)status, SqlDbType = System.Data.SqlDbType.Int
                },
                new SqlParameter()
                {
                    ParameterName = "@code", Value = code, SqlDbType = System.Data.SqlDbType.VarChar, Size = 36
                },
            };

            if (count == 0)
            {
                return(dataCenter.ExecuteNonQuery("UPDATE FailMqMessage SET STATUS=@status,UpdateTime=GetDate() WHERE Code = @code", paramList.ToArray()));
            }
            else
            {
                paramList.Add(new SqlParameter()
                {
                    ParameterName = "@RetryNumber", Value = count, SqlDbType = System.Data.SqlDbType.Int
                });
                return(dataCenter.ExecuteNonQuery("UPDATE FailMqMessage SET STATUS=@status,UpdateTime=GetDate(),RetryNumber=RetryNumber+@RetryNumber WHERE Code = @code", paramList.ToArray()));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 重置处理中的状态为待处理
        /// </summary>
        public void ResetStatus()
        {
            DataCenterHelper dataCenter = new DataCenterHelper();
            var paramList = new List <SqlParameter> {
                new SqlParameter()
                {
                    ParameterName = "@status", Value = 0, SqlDbType = System.Data.SqlDbType.Int
                },
                new SqlParameter()
                {
                    ParameterName = "@status1", Value = 1, SqlDbType = System.Data.SqlDbType.Int
                },
            };

            dataCenter.ExecuteNonQuery("UPDATE FailMqMessage SET STATUS=@status,UpdateTime=GetDate() WHERE STATUS=@status1", paramList.ToArray());
        }