コード例 #1
0
        /// <summary>
        /// TransactionEvent 생성 xml 내용을 만든다.
        /// </summary>
        /// <param name="dtEventTime"></param>
        /// <param name="strParentID"></param>
        /// <param name="strEpcList"></param>
        /// <param name="eAction"></param>
        /// <param name="strBizStep"></param>
        /// <param name="strDispostion"></param>
        /// <param name="strReadPoint"></param>
        /// <param name="strbizLocation">bizlocatitonType/Value 형태로 데이터 넘길것..</param>
        /// <param name="strbizTransactionList"></param>
        public void SetTransactionEvent(DateTime dtEventTime, string strParentID, string[] strEpcList,
                                        enAction eAction, string strBizStep, string strDispostion, string[] strReadPoint,
                                        string[] strbizLocation, string [] strbizTransactionList)
        {
            xml.chNode2Root();
            xml.chSingleNode("EPCISBody/EventList");


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

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

            int i = xnl.Count;

            xml.xmlNode = xnl[i - 1];

            string strEventTime = Time2EpcTime(dtEventTime);

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


            xml.AddChild("bizTransactionList", string.Empty);
            foreach (string str in strbizTransactionList)
            {
                string[] strV = str.Split(new string[] { "/" }, StringSplitOptions.None);
                xml.AddAttChild("bizTransactionList", "bizTransaction", strV[0], "type", strV[1]);
            }

            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", strDispostion);
            foreach (string str in strReadPoint)
            {
                xml.AddChild("readPoint", "id", str);
            }


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

            xml.chNode2Root();

            //xml.SaveToFile(@"test_AggregationEvent.xml");
        }
コード例 #2
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("");
        }
コード例 #3
0
        /// <summary>
        /// 어그리게이션 이벤트를 올린다.
        /// </summary>
        /// <param name="dtEventTime"></param>
        /// <param name="strParentID"></param>
        /// <param name="strChildEpc"></param>
        /// <param name="eAction"></param>
        /// <param name="strBizStep"></param>
        /// <param name="strDispostion"></param>
        /// <param name="strReadPoint"></param>
        /// <param name="strbizLocation"></param>
        public void SetAggregationEvent(DateTime dtEventTime, string strParentID, string[] strChildEpc,
                                        enAction eAction, string strBizStep, string strDispostion, string[] strReadPoint, string[] strbizLocation)
        {
            xml.chNode2Root();
            xml.chSingleNode("EPCISBody/EventList");


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

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

            int i = xnl.Count;

            xml.xmlNode = xnl[i - 1];


            string strEventTime = Time2EpcTime(dtEventTime);

            xml.AddChild("eventTime", strEventTime);

            xml.AddChild("eventTimeZoneOffset", strTimeZoneOffSet);

            xml.AddChild("parentID", strParentID);

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

            foreach (string str in strChildEpc)
            {
                if (str != null && str != string.Empty)
                {
                    xml.AddChild("childEPCs", "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.SaveToFile(@"test_AggEvet.xml");

            xml.chNode2Root();
        }