コード例 #1
0
        private IEnumerable <object> generateAcctPath(GncAccount acct)
        {
            var path = acct.PathAsList(_account);

            if (path.Count == 0)
            {
                yield return(new I(Tr.PgTrns.ThisAccount));
            }
            else
            {
                for (int i = 0; i < path.Count - 1; i++)
                {
                    yield return(new A(path[i].Name)
                    {
                        class_ = "nocolor", href = Request.Url.WithQuery("Acct", path[i].Path(":")).ToHref()
                    });

                    yield return(" : ");
                }
                if (path.Count > 0)
                {
                    var pathlast = path[path.Count - 1];
                    yield return(new A(pathlast.Name)
                    {
                        class_ = "nocolor", href = Request.Url.WithQuery("Acct", pathlast.Path(":")).ToHref()
                    });
                }
            }
        }
コード例 #2
0
ファイル: Spinneret.cs プロジェクト: rstarkov/AccountsWeb
        public IEnumerable <object> GetAccountBreadcrumbs(string acctArgName, GncAccount account)
        {
            var path = account == null ? null : account.PathAsList();

            if (account == null || path.Count == 0)
            {
                yield return new SPAN(account.Book.AccountRoot.Name)
                       {
                           class_ = "aw-breadcrumbs aw-current"
                       }
            }
            ;
            else
            {
                yield return(new A(account.Book.AccountRoot.Name)
                {
                    class_ = "aw-breadcrumbs", href = Request.Url.WithQuery(acctArgName, "").ToHref()
                });

                yield return(" : ");

                foreach (var item in path.Take(path.Count - 1))
                {
                    yield return(new A(item.Name)
                    {
                        class_ = "aw-breadcrumbs", href = Request.Url.WithQuery(acctArgName, item.Path(":")).ToHref()
                    });

                    yield return(" : ");
                }
                yield return(new SPAN(path.Last().Name)
                {
                    class_ = "aw-breadcrumbs aw-current"
                });
            }
        }