コード例 #1
0
        Account GetEquivalentAccout(XMLBookAccount bookAccount)
        {
            Account account = new Account();

            account.Name         = bookAccount.name;
            account.GUID         = bookAccount.id.Value;
            account.AnsestorList = bookAccount.AnsestorList;
            return(account);
        }
コード例 #2
0
ファイル: GNUCashMgr.cs プロジェクト: kiranvr/GnuCashCSLib
        void AddParentInfo(XMLBookAccount account)
        {
            var parent = GnuCashRecordRoot.Book.Account.Where(x => x.id.Value == account.parent.Value).FirstOrDefault();
            Tuple <string, string> ancestor = Tuple.Create(account.id.Value, account.name);

            ancestorList.Add(ancestor);
            if (parent != null)
            {
                AddParentInfo(parent);
            }
        }
コード例 #3
0
ファイル: GNUCashMgr.cs プロジェクト: kiranvr/GnuCashCSLib
        void VisitChildren(XMLBookAccount account, bool isRoot)
        {
            ancestorList = new List <Tuple <string, string> >();


            AddParentInfo(account);

            account.AnsestorList = this.ancestorList;

            var children = GnuCashRecordRoot.Book.Account.Where(x => x.parent.Value == account.id.Value).ToList();

            foreach (var child in children)
            {
                VisitChildren(child, false);
            }
        }