Label_LZ.cs 2.3 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OnlineStore.DeviceLibrary
{
    /// <summary>
    /// 立臻标签
    /// </summary>
    public class Label_LZ
    {
        public Label_LZ(string liaohao, string mianbie, string jitai, string line, string slot = "slot", string subslot = "subslot")
        {
            this.pn = $"料 号:{liaohao}";
            this.side = $"{mianbie}";
            this.line = $"线 别:{line} /{this.side}";
            this.station = $"机 台:{jitai}";
            this.slot = $"站 别:{slot}{subslot}";
            this.shijian = $"时 间:{DateTime.Now.ToString()}";
        }
        public Label_LZ() { }
        public string barcode { get; set; } = "";
        public string pn { get; set; } = "";
        public string line { get; set; } = "";
        /// <summary>
        /// 站位
        /// </summary>
        public string slot { get; set; }
        /// <summary>
        /// 点位
        /// </summary>
        public string subslot { get; set; }
        /// <summary>
        /// 线别
        /// </summary>
        public string side { get; set; } = "";
        /// <summary>
        /// 机台
        /// </summary>
        public string station { get; set; } = "";
        /// <summary>
        /// 时间
        /// </summary>
        public string shijian { get; set; } = "";
        /// <summary>
        /// 需求单
        /// </summary>
        public string hSerial { get; set; } = "";

        public string ToStr()
        {
            return $"二维码:{barcode},需求单:{hSerial},料号:{pn},机台:{station},面别:{side},线别:{line},站位:{slot},点位:{subslot}";
        }
        /// <summary>
        /// 拷贝一个新的实例
        /// </summary>
        /// <returns></returns>
        public Label_LZ ToCopy()
        {
            Label_LZ posInfo = new Label_LZ();
            System.Reflection.PropertyInfo[] info1 = posInfo.GetType().GetProperties();
            System.Reflection.PropertyInfo[] info2 = this.GetType().GetProperties();
            for (int i = 0; i < info1.Length; i++)
                info1[i].SetValue(posInfo, info2[i].GetValue(this));
            return posInfo;

        }
    }
}