using System;
using bizFacade;
//using SystemFramework;
using MesServerWork;

namespace MesServerFunctions
{
    partial class FunctionMES
    {
        /// <summary>
        /// 申请上线(针对上线工位)
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        private void PartLoadInPallet(object e)
        {
            try
            {
                DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
                string OpName = Convert.ToString(msgEvent.OpName);
                int tagValue = Convert.ToInt32(msgEvent.TagValue);

                if (tagValue == 1)
                {
                    // 读取上线轮毂号，进行确认上线的操作
                    string EngineID_lungu;
                    MIS_BASE.Read_TagTypeID(40, OpName, out EngineID_lungu);

                    Db.UpLoadOpNameInsert_Lungu(EngineID_lungu, OpName);
                    MIS_BASE.WritePLC(30, OpName, "1");
                }
                else
                {
                    MIS_BASE.WritePLC(30, OpName, "0");
                }
            }
            catch (Exception err)
            {
                ////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
            }
        }
    }
}
