コード例 #1
0
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            this.View = SpaTemplateViewModel.GetTemplateByPath(Template, Specificulture, _context, _transaction).Data;
            var getDataResult = SpaModuleDataViewModel.Repository
                                .GetModelListBy(m => m.ModuleId == Id && m.Specificulture == Specificulture
                                                , "Priority", OrderByDirection.Ascending, null, null
                                                , _context, _transaction);

            if (getDataResult.IsSucceed)
            {
                getDataResult.Data.JsonItems = new List <JObject>();
                getDataResult.Data.Items.ForEach(d => getDataResult.Data.JsonItems.Add(d.JItem));
                Data = getDataResult.Data;
            }

            var getArticles = InfoArticleViewModel.GetModelListByModule(Id, Specificulture, SWCmsConstants.Default.OrderBy, OrderByDirection.Ascending
                                                                        , 4, 0
                                                                        , _context: _context, _transaction: _transaction
                                                                        );

            if (getArticles.IsSucceed)
            {
                Articles = getArticles.Data;
            }

            var getProducts = InfoProductViewModel.GetModelListByModule(Id, Specificulture, SWCmsConstants.Default.OrderBy, OrderByDirection.Ascending
                                                                        , 4, 0
                                                                        , _context: _context, _transaction: _transaction
                                                                        );

            if (getProducts.IsSucceed)
            {
                Products = getProducts.Data;
            }
        }
コード例 #2
0
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            this.View = SpaTemplateViewModel.GetTemplateByPath(Template, Specificulture, _context, _transaction).Data;
            //Columns = new List<ModuleFieldViewModel>();
            //JArray arrField = !string.IsNullOrEmpty(Fields) ? JArray.Parse(Fields) : new JArray();
            //foreach (var field in arrField)
            //{
            //    ModuleFieldViewModel thisField = new ModuleFieldViewModel()
            //    {
            //        Name = CommonHelper.ParseJsonPropertyName(field["Name"].ToString()),
            //        DataType = (SWCmsConstants.DataType)(int)field["DataType"],
            //        Width = field["Width"] != null ? field["Width"].Value<int>() : 3,
            //        IsDisplay = field["IsDisplay"] != null ? field["IsDisplay"].Value<bool>() : true
            //    };
            //    Columns.Add(thisField);
            //}

            //this.Templates = Templates ?? TemplateRepository.Instance.GetTemplates(SWCmsConstants.TemplateFolder.Modules);

            var getDataResult = SpaModuleDataViewModel.Repository
                                .GetModelListBy(m => m.ModuleId == Id && m.Specificulture == Specificulture
                                                , "Priority", OrderByDirection.Ascending, null, null
                                                , _context, _transaction);

            if (getDataResult.IsSucceed)
            {
                getDataResult.Data.JsonItems = new List <JObject>();
                getDataResult.Data.Items.ForEach(d => getDataResult.Data.JsonItems.Add(d.JItem));
                Data = getDataResult.Data;
            }

            //LoadData(ArticleId, CategoryId, _context: _context, _transaction: _transaction);

            var getArticles = InfoArticleViewModel.GetModelListByModule(Id, Specificulture, SWCmsConstants.Default.OrderBy, OrderByDirection.Ascending
                                                                        , 4, 0
                                                                        , _context: _context, _transaction: _transaction
                                                                        );

            if (getArticles.IsSucceed)
            {
                Articles = getArticles.Data;
            }

            var getProducts = InfoProductViewModel.GetModelListByModule(Id, Specificulture, SWCmsConstants.Default.OrderBy, OrderByDirection.Ascending
                                                                        , 4, 0
                                                                        , _context: _context, _transaction: _transaction
                                                                        );

            if (getProducts.IsSucceed)
            {
                Products = getProducts.Data;
            }
        }