Exemplo n.º 1
0
        public IEnumerable <XElement> GetEvents(DateTime fromInclusive, DateTime toInclusive, String readPointEPC)
        {
            ServiceReference1.EpcisEventServiceClient client = new ServiceReference1.EpcisEventServiceClient();

            IEnumerable <XElement> iexe = client.GetEvents(fromInclusive, toInclusive, readPointEPC);

            return(iexe);
        }
Exemplo n.º 2
0
        // Forward mehtods
        public IEnumerable <String> GetFilenames()
        {
            ServiceReference1.EpcisEventServiceClient client = new ServiceReference1.EpcisEventServiceClient();

            IEnumerable <String> filenames = client.GetFilenames();

            client.Close();

            return(filenames);
        }
Exemplo n.º 3
0
        public XElement GetEvent(string filename)
        {
            ServiceReference1.EpcisEventServiceClient client = new ServiceReference1.EpcisEventServiceClient();

            XElement e = new XElement("root", null);

            e = client.GetEvent(filename);

            client.Close();

            return(e);
        }
Exemplo n.º 4
0
        //Unique methods
        //Hämtar alla events inom angivet datumintervall
        public XElement GetEventsForLocation(string locationUrn, DateTime fromDate, DateTime toDate, bool resetMasterData)
        {
            if (resetMasterData == true)
            {
                Locations.RemoveAll();
                Vehicles.RemoveAll();
            }


            ServiceReference1.EpcisEventServiceClient client = new ServiceReference1.EpcisEventServiceClient();

            XElement[] reply = new XElement[1];

            reply = client.GetEvents(fromDate, toDate, locationUrn);

            client.Close();

            // add vehicle
            foreach (XElement x in reply.Descendants("epcList"))
            {
                x.AddAfterSelf(new XElement(VehicleFromService(x.Element("epc").Value.ToString())));
            }

            // add location
            foreach (XElement x in reply.Descendants("ObjectEvent").Descendants("readPoint"))
            {
                x.AddAfterSelf(new XElement(LocationFromService(x.Element("id").Value.ToString())));
            }

            XElement replyAsXElement = new XElement("FordonsPassager", null);

            // tvätta
            foreach (XElement x in reply.Descendants("ObjectEvent"))
            {
                x.Element("eventTime").Name = "Tid";
                x.Element("eventTimeZoneOffset").Remove();
                x.Element("epcList").Remove();
                x.Element("action").Remove();
                x.Element("bizStep").Remove();
                x.Element("readPoint").Remove();
                x.Name = "FordonPassage";

                replyAsXElement.Add(x);
            }

            return(replyAsXElement);
        }