DevTreks.Data/AppHelpers/Prices.cs
/// <summary>
/// Build and save sub totals documents based on the group totals document sent in.
/// </summary>
Build and save sub totals documents based on the group totals document sent in.
Build and save sub totals documents based on the group totals document sent in .
private async Task<bool> InitSaveTotals(ContentURI docToCalcURI, ContentURI calcDocURI, 
            XPathNodeIterator totalsNodeIterator, XmlDocument baseDoc, 
            string directoryPath, IDictionary<string, string> childrenLinkedView)
        {
            bool bHasCompleted = false;
            if (totalsNodeIterator != null)
            {
                XPathNavigator oNavigator = totalsNodeIterator.Current.Clone();
                if (oNavigator.LocalName == Helpers.GeneralHelpers.ROOT_PATH)
                {
                    totalsNodeIterator.MoveNext();
                }
                XmlElement oDocElement = (XmlElement)((IHasXmlNode)totalsNodeIterator.Current).GetNode().CloneNode(false);
                AppHelpers.LinkedViews oLinkedView = new AppHelpers.LinkedViews();
                oLinkedView.SaveSummaryDoc(docToCalcURI, calcDocURI, oDocElement,
                    baseDoc, oNavigator, directoryPath, childrenLinkedView);
                bool bIsDeepClone = false;
                EditHelpers.XmlIO.AppendNodeToLastDocNode(oDocElement, bIsDeepClone,
                    baseDoc.FirstChild, ref baseDoc);
                await oLinkedView.SaveFullDoc(docToCalcURI, calcDocURI, oDocElement,
                    baseDoc, oNavigator, directoryPath, childrenLinkedView);
            }
            bHasCompleted = true;
            return bHasCompleted;
        }
private async Task < bool > InitSaveTotals ( ContentURI docToCalcURI , ContentURI calcDocURI , XPathNodeIterator totalsNodeIterator , XmlDocument baseDoc , string directoryPath , IDictionary < string , string > childrenLinkedView ) { bool bHasCompleted = false ; if ( totalsNodeIterator != null ) { XPathNavigator oNavigator = totalsNodeIterator . Current . Clone ( ) ; if ( oNavigator . LocalName == Helpers . GeneralHelpers . ROOT_PATH ) { totalsNodeIterator . MoveNext ( ) ; } XmlElement oDocElement = ( XmlElement ) ( ( IHasXmlNode ) totalsNodeIterator . Current ) . GetNode ( ) . CloneNode ( false ) ; AppHelpers . LinkedViews oLinkedView = new AppHelpers . LinkedViews ( ) ; oLinkedView . SaveSummaryDoc ( docToCalcURI , calcDocURI , oDocElement , baseDoc , oNavigator , directoryPath , childrenLinkedView ) ; bool bIsDeepClone = false ; EditHelpers . XmlIO . AppendNodeToLastDocNode ( oDocElement , bIsDeepClone , baseDoc . FirstChild , ref baseDoc ) ; await oLinkedView . SaveFullDoc ( docToCalcURI , calcDocURI , oDocElement , baseDoc , oNavigator , directoryPath , childrenLinkedView ) ; } bHasCompleted = true ; return bHasCompleted ; }
Build and save sub totals documents based on the group totals document sent in.
Build and save sub totals documents based on the group totals document sent in .
//create a navigator to navigate through children //clone just the node (not the children) for the various documents //save the summary docs //the base doc has these shallow cloned elements added //save the full docs
docToCalcURI
ContentURI
calcDocURI
ContentURI
totalsNodeIterator
XPathNodeIterator
baseDoc
XmlDocument
directoryPath
string
childrenLinkedView
IDictionary<string, string>