private void BuildStainResult(YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen surgicalSpecimen, XElement surgicalSpecimenElement)
        {
            List <XElement> collectionElements = (from item in surgicalSpecimenElement.Elements("StainResultItemCollection")
                                                  select item).ToList <XElement>();

            foreach (XElement stainResultElement in collectionElements.Elements("StainResultItem"))
            {
                YellowstonePathology.Business.SpecialStain.StainResultItem  stainResultItem   = new SpecialStain.StainResultItem();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(stainResultElement, stainResultItem);
                xmlPropertyWriter.Write();
                surgicalSpecimen.StainResultItemCollection.Add(stainResultItem);
            }
        }
 private void BuildStainResult(YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen surgicalSpecimen, XElement surgicalSpecimenElement)
 {
     List<XElement> collectionElements = (from item in surgicalSpecimenElement.Elements("StainResultItemCollection")
                                          select item).ToList<XElement>();
     foreach (XElement stainResultElement in collectionElements.Elements("StainResultItem"))
     {
         YellowstonePathology.Business.SpecialStain.StainResultItem stainResultItem = new SpecialStain.StainResultItem();
         YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(stainResultElement, stainResultItem);
         xmlPropertyWriter.Write();
         surgicalSpecimen.StainResultItemCollection.Add(stainResultItem);
     }
 }
        private void BuildStainResult(YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen surgicalSpecimen, XElement surgicalSpecimenElement)
        {
            List<XElement> collectionElements = (from item in surgicalSpecimenElement.Elements("StainResultItemCollection")
                                                 select item).ToList<XElement>();

            surgicalSpecimen.StainResultItemCollection.RemoveDeleted(collectionElements.Elements("StainResultItem"));
            foreach (XElement stainResultElement in collectionElements.Elements("StainResultItem"))
            {
                string stainResultId = stainResultElement.Element("StainResultId").Value;
                YellowstonePathology.Business.SpecialStain.StainResultItem stainResultItem = null;
                if (surgicalSpecimen.StainResultItemCollection.Exists(stainResultId) == true)
                {
                    stainResultItem = surgicalSpecimen.StainResultItemCollection.Get(stainResultId);
                }
                else
                {
                    stainResultItem = new SpecialStain.StainResultItem();
                    surgicalSpecimen.StainResultItemCollection.Add(stainResultItem);
                }
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(stainResultElement, stainResultItem);
                xmlPropertyWriter.Write();
            }
        }