duheng
2024-04-22 a549072a040749f7c732c83d2d0f138614ac08e5
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace IStation.Dto
{
    /// <summary>
    /// 执行返回的通用类,该类带有详细的业务数据,除了告诉用户此次调用是否成功与否,以及一个表示提示信息的字符串外,还带的详细的业务数据
    /// </summary>
    public class ApiResult_Boolean : ApiResult
    {
        /// <summary>
        /// 业务数据
        /// </summary>
        public Boolean IsOK { get; set; }
 
        /// <summary>
        /// 构造函数
        /// </summary>
        public ApiResult_Boolean() { }
 
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="IsOK">是否成功</param>
        /// <param name="type">状态标识</param>
        /// <param name="message">提示信息</param>
        public ApiResult_Boolean(bool IsOK, IStation.Dto.ApiResultCode type, string message)
            : base(type, message)
        {
            this.IsOK = IsOK;
        }
 
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="IsOK">是否成功</param>
        public ApiResult_Boolean(bool IsOK)
        {
            this.Code = IsOK ? IStation.Dto.ApiResultCode.Success : IStation.Dto.ApiResultCode.Error;
            this.Message = "";
            this.IsOK = IsOK;
        }
    }
 
}