コード例 #1
0
        public void UpdateData(XDocument doc, string columnName, string tagName)
        {
            IEnumerable <System.Xml.Linq.XElement> eventElements = doc.Descendants(Constants.Event.eventElement);

            foreach (System.Xml.Linq.XElement eventElement in eventElements)
            {
                var workElements = eventElement.Descendants(Constants.Work.workElement);
                foreach (var workElement in workElements)
                {
                    Work workItem = Work.GetWorkFromNode(workElement);

                    IEnumerable <System.Xml.Linq.XElement> workDocumentElements = workElement.Descendants(Constants.WorkDocument.workDocumentElement);
                    foreach (var workDocumentElement in workDocumentElements)
                    {
                        int documentID = 0;
                        int.TryParse((string)workDocumentElement.GetXElement(Constants.WorkArtist.workArtistIDElement), out documentID);

                        WorkDocument updateWorkDocument = WorkDocument.GetDocumentByID(documentID, workItem.WorkID);

                        updateWorkDocument = WorkDocument.BuildWorkDocument(workDocumentElement, documentID, updateWorkDocument);

                        if (updateWorkDocument == null)
                        {
                            continue;
                        }

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

                        BsoArchiveEntities.UpdateObject(updateWorkDocument, newValue, columnName);

                        BsoArchiveEntities.Current.Save();
                    }
                }
            }
        }
コード例 #2
0
        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)
            {
                Conductor updateConductor = Conductor.GetConductorFromNode(element);
                System.Xml.Linq.XElement conductorNode = element.Element(Constants.Conductor.conductorElement);
                if (conductorNode == null)
                {
                    continue;
                }

                object newValue = conductorNode.GetXElement(tagName);
                BsoArchiveEntities.UpdateObject(updateConductor, newValue, columnName);
            }
        }
コード例 #3
0
        /// <summary>
        /// Updates the existing database Instrument 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.Artist.artistElement);

            foreach (System.Xml.Linq.XElement element in eventElements)
            {
                Instrument updateInstrument = Instrument.GetInstrumentFromNode(element);

                if (updateInstrument == null)
                {
                    continue;
                }

                object newValue = element.GetXElement(tagName);

                BsoArchiveEntities.UpdateObject(updateInstrument, newValue, columnName);
            }
        }
コード例 #4
0
        /// <summary>
        /// Updates the existing database TypeGroup 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)
            {
                EventTypeGroup updateTypeGroup = EventTypeGroup.GetEventTypeGroupFromNode(element);

                if (updateTypeGroup == null)
                {
                    continue;
                }

                System.Xml.Linq.XElement typeGroupNode = element.Element(Constants.EventTypeGroup.typeGroupElement);

                object newValue = typeGroupNode.GetXElement(tagName);

                BsoArchiveEntities.UpdateObject(updateTypeGroup, newValue, columnName);
            }
        }
コード例 #5
0
ファイル: Season.cs プロジェクト: rossancedev/HENRY-archives
        /// <summary>
        /// Updates the existing database Season 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)
            {
                Season updateSeason = Season.GetSeasonFromNode(element);

                if (updateSeason == null)
                {
                    continue;
                }

                System.Xml.Linq.XElement seasonNode = element.Element(Constants.Season.seasonElement);

                object newValue = seasonNode.GetXElement(tagName);

                BsoArchiveEntities.UpdateObject(updateSeason, newValue, columnName);
            }
        }
コード例 #6
0
ファイル: Project.cs プロジェクト: rossancedev/HENRY-archives
        /// <summary>
        /// Updates the existing database Project 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)
            {
                Project updateProject = Project.GetProjectFromNode(element);

                if (updateProject == null)
                {
                    continue;
                }

                System.Xml.Linq.XElement projectNode = element.Element(Constants.Project.projectElement);

                object newValue = projectNode.GetXElement(tagName);

                BsoArchiveEntities.UpdateObject(updateProject, newValue, columnName);
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
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);
            }
        }
コード例 #9
0
        /// <summary>
        /// Update given column from xml given the tag name
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="columnName"></param>
        /// <param name="tagName"></param>
        /// <remarks>
        /// Read Composer information from OPAS XML and update the Composer Column based upon appropriate tagName
        /// </remarks>
        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)
            {
                IEnumerable <System.Xml.Linq.XElement> composerElements = element.Descendants(Constants.Work.workComposerElement);
                foreach (System.Xml.Linq.XElement composer in composerElements)
                {
                    Composer updateComposer = Composer.GetComposerFromNode(composer);

                    if (updateComposer == null)
                    {
                        continue;
                    }

                    object newValue = composer.GetXElement(tagName);

                    BsoArchiveEntities.UpdateObject(updateComposer, newValue, columnName);
                }
            }
        }
コード例 #10
0
ファイル: Work.cs プロジェクト: rossancedev/HENRY-archives
        /// <summary>
        /// Updates the existing database Work 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)
            {
                //System.Xml.Linq.XElement workNode = element.Element(Constants.Work.workElement);
                var workNodes = element.Descendants(Constants.Work.workElement);
                foreach (var workNode in workNodes)
                {
                    Work updateWork = Work.GetWorkFromNode(workNode);

                    if (updateWork == null)
                    {
                        continue;
                    }

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

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