zhao
2021-07-19 8347f2fbddbd25369359dcb2da1233ac48a19fdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/////////////////////////////////////////////////////////////////////////////
//    File Description    : 执行Sql後的结果
//    Copyright           : joyin
// -------------------------------------------------------------------------
//    Date Created        : Mar 26, 2010
//    Author                : jiangxinjun
//    Change Description  : 增加CheckInvalids属性,可以获取执行Sql时,检测输入数据非法时输出错误信息。
//
/////////////////////////////////////////////////////////////////////////////
 
using System;
using System.Collections.Generic;
 
namespace HH.WMS.Entitys.Common
{
    /// <summary>
    /// 执行Sql後的结果
    /// </summary>
    public class SqlExecuteResult
    {
        /// <summary>
        /// true : 执行成功; false:执行失败
        /// </summary>
        public bool Success { get; set; }
 
        /// <summary>
        /// 影响行数
        /// </summary>
        public int Row { get; set; }
 
        /// <summary>
        /// 当Success属性为false的时候,这个属性就可以返回执行失败的异常。
        /// </summary>
        public Exception Exception { get; set; }
 
        public ExceptionClass ExceptionType { get; set; }
 
        /// <summary>
        /// 执行Sql输出的额外参数
        /// </summary>
        /// <remarks>需要的时候才设置,一般情况下为null。</remarks>
        public object TokenObject { get; set; }
 
        /// <summary>
        /// 检测输入的参数是否有误
        /// </summary>
        public List<CheckInvalidValue> CheckInvalids { get; set; }
 
        /// <summary>
        /// 根据检验参数错误结果,返回SqlExecuteResult
        /// </summary>
        /// <param name="invalids"></param>
        /// <returns></returns>
        public static SqlExecuteResult Create(List<CheckInvalidValue> invalids)
        {
            return new SqlExecuteResult()
            {
                Success = false,
                Exception = new CheckInvalidValueException(),
                CheckInvalids = invalids
            };
        }
 
        public enum ExceptionClass
        {
            /// <summary>
            /// 1 - 程序异常
            /// </summary>
            Exception = 1,
            /// <summary>
            /// 2 - 业务异常
            /// </summary>
            BussException = 2
        }
    }
 
 
    public class AutobomResult
    {
        /// <summary>
        /// 0:成功   1:失败
        /// </summary>
        public string rescode { get; set; }
 
        /// <summary>
        /// 执行结果 
        /// </summary>
        public string result { get; set; }
 
        /// <summary>
        /// 执行错误写入物料编码
        /// </summary>
        public string code { get; set; }
    }
}