MaterialCodeMatch.cs
1.8 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
using System;
namespace Model
{
/// <summary>
/// 物料模板条码匹配条件
/// </summary>
public class MaterialCodeMatch
{
public int CodeID { get; set; } = -1;
public string Keyword { get; set; } = "";
public bool MatchStart { get; set; } = false;
public bool MatchMiddle { get; set; } = false;
public bool MatchEnd { get; set; } = false;
public bool MatchSplit { get; set; } = false;
public bool CheckCodeType { get; set; } = false;
public string CodeType { get; set; } = "";
public string StartText { get; set; } = "";
public string MiddleText { get; set; } = "";
public int MatchMiddleType { get; set; } = -1;
public int MiddleTextCount { get; set; } = 1;
public string EndText { get; set; } = "";
public string SplitText { get; set; } = "";
public bool CaseSensitive { get; set; } = false;
public bool MatchMinLength { get; set; } = false;
public bool MatchMaxLength { get; set; } = false;
public int MinLength { get; set; } = 0;
public int MaxLength { get; set; } = 0;
public int SubstringStart { get; set; } = 0;
public int SubstringLength { get; set; } = 1;
public int SplitPart { get; set; } = 1;
public bool MatchISNumber { get; set; } = false;
public MaterialCodeMatch Clone()
{
MaterialCodeMatch node = new();
System.Reflection.PropertyInfo[] destination = node.GetType().GetProperties();
System.Reflection.PropertyInfo[] orgin = GetType().GetProperties();
for (int i = 0; i < destination.Length; i++)
destination[i].SetValue(node, orgin[i].GetValue(this));
return node;
}
}
}