Example #1
0
        /// <summary>
        /// Create EventOrchestra object
        /// </summary>
        /// <param name="eventItem"></param>
        /// <remarks>
        /// Takes an Event object along with an XElement node and returns
        /// an EventOrchestra object based on the Event object and the Orchestra
        /// object created from the XElement node.
        /// </remarks>
        /// <param name="node"></param>
        public Orchestra AddEventOrchestra(Event eventItem, XElement node)
        {
            Log.Debug("Started adding event orchestra.");
            Orchestra orchestraItem = Orchestra.GetOrchestraFromNode(node);

            if (orchestraItem != null && orchestraItem.OrchestraID != 0)
            {
                eventItem.Orchestra = orchestraItem;
            }

            Log.Debug("Finished adding event orchestra.");
            return(orchestraItem);
        }
Example #2
0
        /// <summary>
        /// Updates the existing database Orchestra 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)
            {
                Orchestra updateOrchestra = Orchestra.GetOrchestraFromNode(element);

                if (updateOrchestra == null)
                {
                    continue;
                }

                System.Xml.Linq.XElement orchestraNode = element.Element(Constants.Orchestra.orchestraElement);

                object newValue = orchestraNode.GetXElement(tagName);

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