Example #1
0
        public ViewBaseModel(BaseController controller)
        {
            if (controller == null)
            {
                throw new ArgumentNullException("controller");
            }
            this._isLogin = controller.IsLogin;
            this._isVirtualAccount = controller.IsVirtualAccount;
            this._loginUserInfo = string.Format(SiteCommonResource.TextFormatUserInfo,
                controller.LoginUserName, controller.LoginAccount);
            HttpContext context = HttpContext.Current;
            SiteMenuModel menuRoot = CacheManager.GetSiteMenus(context);
            this._rootMenus = menuRoot.SubMenus;
            string relativePath = string.Format("~/{0}/{1}",
                controller.ValueProvider.GetValue("controller").RawValue, controller.ValueProvider.GetValue("action").RawValue);
            SiteMenuModel siteMenuCurrentNode = SiteMenuModel.GetSiteMenuCurrentNode(relativePath);
            if (siteMenuCurrentNode != null)
            {
                this._currentRootMenu = siteMenuCurrentNode;
                while (this._currentRootMenu.ParentMenu != null && this._currentRootMenu.ParentMenu != menuRoot)
                {
                    this._currentRootMenu = this._currentRootMenu.ParentMenu;
                }
            }

            this._breadCrumbCurrentNode = SiteMenuModel.GetBreadCrumbCurrentNode(relativePath);
            if (this._breadCrumbCurrentNode != null)
            {
                this._breadCrumb = new List<SiteMenuModel>();
                SiteMenuModel parentNode = this._breadCrumbCurrentNode.ParentMenu;
                while (parentNode != null)
                {
                    this._breadCrumb.Insert(0, parentNode);
                    parentNode = parentNode.ParentMenu;
                }
            }
        }
Example #2
0
 public ViewProductReportModel(BaseController controller)
     : base(controller)
 {
 }