This commit is contained in:
qianjiawei
2023-07-21 15:16:22 +08:00
parent 7bb60e3018
commit 9b779d5407
8 changed files with 171 additions and 34 deletions

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@@ -14,18 +16,48 @@ namespace Tnb.QcMgr.Entities.Enums
}
public enum EnumTriggerEvent
{
[Remark("首件检", "换模具")]
= 1,
[Remark("首件检", "换物料批号")]
= 2,
[Remark("首件检", "换物料编号")]
= 3,
[Remark("首件检", "新的生产任务")]
= 4,
[Remark("首件检", "生产任务暂停")]
= 5,
[Remark("出厂检", "按入厂频次")]
= 6,
[Remark("入厂检", "按物料频次")]
= 7,
[Remark("入厂检", "按物料编号")]
= 8,
[Remark("生产检", "定量")]
= 9,
[Remark("生产检", "定码")]
= 10,
[Remark("生产检", "产出频次")]
= 11,
[Remark("生产检", "固定次数")]
= 12,
[Remark("生产检", "按流转卡")]
= 13
}
public class RemarkAttribute : Attribute
{
public string CheckType { get; set; }
public string CheckContent { get; set; }
public RemarkAttribute(string checkType, string checkContent)
{
this.CheckType = checkType;
this.CheckContent = checkContent;
}
public static RemarkAttribute GetRemark(EnumTriggerEvent? enumTriggerEvent)
{
FieldInfo fi = enumTriggerEvent!.GetType().GetField(enumTriggerEvent.ToString()!)!;
object[] attributes = fi.GetCustomAttributes(typeof(RemarkAttribute), false);
return ((RemarkAttribute)attributes[0]);
}
}
}