Ejemplo n.º 1
0
        /// <summary>
        /// Create EventVenue object
        /// </summary>
        /// <param name="eventItem"></param>
        /// <remarks>
        /// Takes an Event object along with an XElement node and returns an
        /// EventVenue item based on the Even object and the Venue object created
        /// from the given node.
        /// </remarks>
        /// <param name="node"></param>
        public Venue AddEventVenue(Event eventItem, XElement node)
        {
            Log.Debug("Started adding event venue.");
            Venue venueItem = Venue.GetVenueFromNode(node);

            if (venueItem != null && venueItem.VenueID != 0)
            {
                eventItem.Venue = venueItem;
            }

            Log.Debug("Finished adding event venue.");
            return(venueItem);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the existing database Venue on the column name using the
        /// XML document parsed using the tagName.
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="columnName"></param>
        /// <param name="tagName"></param>
        public void UpdateData(System.Xml.Linq.XDocument doc, string columnName, string tagName)
        {
            IEnumerable <System.Xml.Linq.XElement> eventElements = doc.Descendants(Constants.Event.eventElement);

            foreach (System.Xml.Linq.XElement element in eventElements)
            {
                Venue updateVenue = Venue.GetVenueFromNode(element);

                if (updateVenue == null)
                {
                    continue;
                }

                System.Xml.Linq.XElement venueNode = element.Element(Constants.Venue.venueElement);

                object newValue = (string)venueNode.GetXElement(tagName);

                BsoArchiveEntities.UpdateObject(updateVenue, newValue, columnName);
            }
        }