v9.6.2017.0808   重构正向工程,基于映射表查找数据库字段类型到实体类型的映射
大石头 authored at 2017-08-08 21:38:06
929.00 B
X
@using NewLife.Model;
@using XCode.Membership;
@{
    var user = ViewBag.User as IUser ?? User.Identity as IUser;

    var fact = ObjectContainer.Current.Resolve<IMenuFactory>();

    var item = Model as IMenu;
    var childs = fact.GetMySubMenus(item.ID).Where(m => m.Visible);
    var url = item.Url.IsNullOrEmpty() ? "" : Url.Content(item.Url);
}
<li>
    @if (childs.Any())
    {
        <a href="#" class="dropdown-toggle">
            <i class="menu-icon fa fa-caret-right"></i>
            @item.DisplayName
        </a>
    }
    else
    {
        <a href="@url" target="main">
            <i class="menu-icon fa fa-caret-right"></i>
            @item.DisplayName
        </a>

        <b class="arrow"></b>
        <ul class="submenu">
            @foreach (var menu in childs)
            {
                @Html.Partial("_Left_Item", menu);
            }
        </ul>
    }
</li>