Ejemplo n.º 1
0
        /// <summary>
        /// object 이벤트를 만든다.
        /// </summary>
        /// <param name="xml"></param>
        /// <param name="dtEventTime"></param>
        /// <param name="strEpcList"></param>
        /// <param name="eAction"></param>
        /// <param name="strBizStep"></param>
        /// <param name="strDispostion"></param>
        /// <param name="strReadPoint"></param>
        /// <param name="strbizLocation"></param>
        public void SetObjectEvnet(DateTime dtEventTime, string [] strEpcList, enAction eAction, string strBizStep, string strDispostion, string [] strReadPoint, string [] strbizLocation)
        {
            xml.chNode2Root();
            xml.chSingleNode("EPCISBody/EventList");


            //ObjectEvent 생성
            xml.AddChild("ObjectEvent", "");

            XmlNodeList xnl = xml.GetNodeList("ObjectEvent");

            int i = xnl.Count;

            xml.xmlNode = xnl[i - 1];

            string strEventTime  = Time2EpcTime(dtEventTime);
            string strRecordTime = Time2EpcTime(DateTime.Now);

            xml.AddChild("eventTime", strEventTime);
            xml.AddChild("recordTime", strRecordTime);
            xml.AddChild("eventTimeZoneOffset", strTimeZoneOffSet);

            xml.AddChild("epcList", string.Empty);

            foreach (string str in strEpcList)
            {
                xml.AddChild("epcList", "epc", str);
            }

            xml.AddChild("action", eAction.ToString());
            xml.AddChild("bizStep", strBizStep);
            xml.AddChild("disposition", strDispostion);


            xml.AddChild("readPoint", string.Empty);

            foreach (string str in strReadPoint)
            {
                xml.AddChild("readPoint", "id", str);
            }

            xml.AddChild("bizLocation", string.Empty);

            foreach (string str in strbizLocation)
            {
                xml.AddChild("bizLocation", "id", str);
            }


            xml.chNode2Root();

            //string strxml = xml.GetSingleNodeInnerXml("");

            //xml.SaveToFile(@"test_ObjectEvet.xml");

            //strTest = xml.GetSingleNodeInnerXml("");
        }