private static MvcHtmlString GetStandalone(HtmlHelper html, IObjectFacade collectionNakedObject, Func<IAssociationFacade, bool> filter, Func<IAssociationFacade, int> order, TagBuilder tag, bool withTitle) {
            Func<IObjectFacade, string> linkFunc = item => html.Object(html.ObjectTitle(item).ToString(), IdConstants.ViewAction, item.Object).ToString();

            string menu = collectionNakedObject.Specification.IsQueryable ? html.MenuOnTransient(collectionNakedObject.GetDomainObject()).ToString() : "";
            string id = collectionNakedObject.Oid == null ? "" : Encode(html.Facade().OidTranslator.GetOidTranslation(collectionNakedObject));

            // can only be standalone and hence page if we have an id 
            tag.InnerHtml += html.CollectionTable(collectionNakedObject, linkFunc, filter, order, !String.IsNullOrEmpty(id), collectionNakedObject.Specification.IsQueryable, withTitle);

            return html.WrapInForm(IdConstants.EditObjectAction,
                html.Facade().GetObjectTypeShortName(collectionNakedObject.GetDomainObject()),
                menu + tag,
                IdConstants.ActionName,
                new RouteValueDictionary(new { id }));
        }
Example #2
0
        private static MvcHtmlString GetStandalone(HtmlHelper html, INakedObject collectionNakedObject, Func<INakedObjectAssociation, bool> filter, Func<INakedObjectAssociation, int> order, TagBuilder tag, bool withTitle) {
            Func<INakedObject, string> linkFunc = item => html.Object(html.ObjectTitle(item).ToString(), IdHelper.ViewAction, item.Object).ToString();

            string menu = collectionNakedObject.Specification.IsQueryable ? html.MenuOnTransient(collectionNakedObject.Object).ToString() : "";
            string id = collectionNakedObject.Oid == null ? "" : FrameworkHelper.GetObjectId(collectionNakedObject);

            // can only be standalone and hence page if we have an id 
            tag.InnerHtml += html.CollectionTable(collectionNakedObject, linkFunc, filter, order, !string.IsNullOrEmpty(id), collectionNakedObject.Specification.IsQueryable, withTitle);

            return html.WrapInForm(IdHelper.EditObjectAction,
                                   FrameworkHelper.GetObjectTypeName(collectionNakedObject.Object),
                                   menu + tag,
                                   IdHelper.ActionName,
                                   new RouteValueDictionary(new {id}));
        }