1
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user