Ejemplo n.º 1
0
        public static ArticleListViewModel Create(ArticleResultBase result, int parentEntityId, string tabId)
        {
            var model = Create <ArticleListViewModel>(tabId, parentEntityId);

            model.ContentId = parentEntityId;
            model.Init(result);
            return(model);
        }
Ejemplo n.º 2
0
        public static ArticleListViewModel Create(ArticleResultBase result, int parentEntityId, string tabId, bool allowMultipleEntitySelection, bool isSelect, int[] ids)
        {
            var model = Create(result, parentEntityId, tabId);

            model.AllowMultipleEntitySelection = allowMultipleEntitySelection;
            model.IsSelect    = isSelect;
            model.SelectedIDs = ids;
            return(model);
        }
Ejemplo n.º 3
0
        public static ArticleListViewModel Create(ArticleResultBase result, int parentEntityId, string tabId, bool allowMultipleEntitySelection, bool isSelect, int id)
        {
            var selectedIds = new int[] { };

            if (id > 0)
            {
                selectedIds = new[] { id };
            }

            return(Create(result, parentEntityId, tabId, allowMultipleEntitySelection, isSelect, selectedIds));
        }
Ejemplo n.º 4
0
        public void Init(ArticleResultBase result)
        {
            ContentName          = result.ContentName;
            IsVirtual            = result.IsVirtual;
            ShowAddNewItemButton = result.IsUpdatable && result.IsAddNewAccessable && !IsWindow && !result.ContentDisableChangingActions;

            if (result is ArticleInitListResult listResult)
            {
                TitleFieldName = listResult.TitleFieldName;
                PageSize       = listResult.PageSize;
                DisplayFields  = listResult.DisplayFields;
            }

            if (result is ArticleInitTreeResult treeResult)
            {
                IsTree            = true;
                CustomFilter      = treeResult.Filter;
                AutoCheckChildren = treeResult.AutoCheckChildren;
            }
        }