private PAP.GenericResponse ReadPapXml()
        {
            try
            {
                var response        = new PAP.GenericResponse();
                var xmlDoc          = XDocument.Load(@"Files\ReceivePAP.xml");
                var packxmldata     = new Packs();
                var packlistxmldata = new PackLists();
                var settings        = new XmlReaderSettings {
                    IgnoreWhitespace = true
                };
                var buffer    = Encoding.ASCII.GetBytes(xmlDoc.ToString());
                var xmlStream = new MemoryStream(buffer);
                using (var xmlReader = XmlReader.Create(xmlStream, settings))
                {
                    var packXmlSerializer     = new XmlSerializer(packxmldata.GetType());
                    var packlistXmlSerializer = new XmlSerializer(packlistxmldata.GetType());
                    packxmldata                  = (Packs)packXmlSerializer.Deserialize(xmlReader);
                    packlistxmldata              = (PackLists)packlistXmlSerializer.Deserialize(xmlReader);
                    response.FailureInformation  = CreatePacksFromXml(packxmldata.PackCollection).FailureInformation;
                    response.FailureInformation += CreatePackListsFromXml(packlistxmldata.PackListCollection);
                }

                return(response);
            }
            catch (Exception ex)
            {
                LoggingMediator.Log("ReadPapXml");
                LoggingMediator.Log(ex);
                throw;
            }
        }
Exemplo n.º 2
0
        internal void DeleteTask(PackTask task)
        {
            var list = PackLists.Where(p => p.PackListId == p.PackListId).FirstOrDefault();

            list.Tasks.Remove(task);
        }
Exemplo n.º 3
0
        public void AddItemToPackList(PackList packList, PackItem item)
        {
            var list = PackLists.Where(p => p.PackListId == packList.PackListId).FirstOrDefault();

            list.PackItems.Add(item);
        }
Exemplo n.º 4
0
        public void DeleteItem(PackItem item)
        {
            var list = PackLists.Where(p => p.PackListId == item.PackListId).FirstOrDefault();

            list.PackItems.Remove(item);
        }
Exemplo n.º 5
0
 public void AddPackList(PackList packList)
 {
     PackLists.Add(packList);
 }