LicensesModel.cs
1.73 KB
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
using HHECS.Infrastructure.CommonHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HHECS.Application.Licenses
{
/// <summary>
/// 授权模型
/// </summary>
public class LicenseModel
{
/// <summary>
/// 机器码,与程序内置的要一致
/// </summary>
public string CustomMachineCode { get; set; }
/// <summary>
/// 客户名称
/// </summary>
public string CustomName { get; set; }
/// <summary>
/// 最后使用时间
/// </summary>
public DateTime LastUseTime { get; set; }
/// <summary>
/// 过期时间expire
/// </summary>
public DateTime ExpireTime { get; set; }
/// <summary>
/// 身份类型
/// </summary>
public LicenseType CustomRole { get; set; }
public override string ToString()
{
if (CustomRole != LicenseType.Free)
{
return $"授权给:{CustomName} / 版本:{CustomRole.ToDescriptionOrString()} / 到期日:{ExpireTime:yyyy-MM-dd HH:mm:ss}";
}
else
{
return $"授权给:{CustomName} / 版本:{CustomRole.ToDescriptionOrString()}";
}
}
}
/// <summary>
/// 几种角色类型
/// </summary>
[Serializable]
public enum LicenseType
{
/// <summary>
/// 试用版
/// </summary>
[Description("试用版")]
Trial = 0,
/// <summary>
/// 正式版
/// </summary>
[Description("正式版")]
Free = 1
}
}