Beispiel #1
0
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            UrlAlias = ApiUrlAliasViewModel.Repository.GetSingleModel(u => u.Specificulture == Specificulture && u.SourceId == Id.ToString()).Data;
            if (UrlAlias == null)
            {
                UrlAlias = new ApiUrlAliasViewModel()
                {
                    Specificulture = Specificulture
                };
            }
            ListSupportedCulture = CommonRepository.Instance.LoadCultures(Specificulture, _context, _transaction);
            ListSupportedCulture.ForEach(c => c.IsSupported = _context.SiocCategory.Any(m => m.Id == Id && m.Specificulture == c.Specificulture));
            if (!string.IsNullOrEmpty(this.Tags))
            {
                ListTag = JArray.Parse(this.Tags);
            }

            this.Templates = this.Templates ?? ApiTemplateViewModel.Repository.GetModelListBy(
                t => t.Template.Name == ActivedTemplate && t.FolderType == this.TemplateFolderType).Data;
            this.View = Templates.FirstOrDefault(t => !string.IsNullOrEmpty(this.Template) && this.Template.Contains(t.FileName + t.Extension));
            this.View = View ?? Templates.FirstOrDefault();
            if (this.View == null)
            {
                this.View = new ApiTemplateViewModel(new SiocTemplate()
                {
                    Extension    = SWCmsConstants.Parameters.TemplateExtension,
                    TemplateId   = GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0),
                    TemplateName = ActivedTemplate,
                    FolderType   = TemplateFolderType,
                    FileFolder   = this.TemplateFolder,
                    FileName     = SWCmsConstants.Default.DefaultTemplate,
                    ModifiedBy   = ModifiedBy,
                    Content      = "<div></div>"
                });
            }
            this.Template = SwCmsHelper.GetFullPath(new string[]
            {
                this.View?.FileFolder
                , this.View?.FileName
            });

            this.ModuleNavs   = GetModuleNavs(_context, _transaction);
            this.ParentNavs   = GetParentNavs(_context, _transaction);
            this.ChildNavs    = GetChildNavs(_context, _transaction);
            this.PositionNavs = GetPositionNavs(_context, _transaction);
        }
Beispiel #2
0
 public override SiocTemplate ParseModel(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
 {
     if (Id == 0)
     {
         CreatedDateTime = DateTime.UtcNow;
     }
     FileFolder = SwCmsHelper.GetFullPath(new string[]
     {
         SWCmsConstants.Parameters.TemplatesFolder
         , TemplateName
         , FolderType
     });
     Content = Content?.Trim();
     Scripts = Scripts?.Trim();
     Styles  = Styles?.Trim();
     return(base.ParseModel(_context, _transaction));
 }
        public bool SaveFile(FileViewModel file)
        {
            try
            {
                if (!string.IsNullOrEmpty(file.Filename))
                {
                    CreateDirectoryIfNotExist(file.FileFolder);

                    string fileName = $"{file.Filename}{file.Extension}";
                    if (!string.IsNullOrEmpty(file.FileFolder))
                    {
                        fileName = SwCmsHelper.GetFullPath(new string[] { file.FileFolder, fileName });
                    }
                    if (File.Exists(fileName))
                    {
                        DeleteFile(fileName);
                    }
                    if (!string.IsNullOrEmpty(file.Content))
                    {
                        using (var writer = File.CreateText(fileName))
                        {
                            writer.WriteLine(file.Content); //or .Write(), if you wish
                            return(true);
                        }
                    }
                    else
                    {
                        string base64 = file.FileStream.Split(',')[1];
                        byte[] bytes  = Convert.FromBase64String(base64);
                        using (var writer = File.Create(fileName))
                        {
                            writer.Write(bytes, 0, bytes.Length);
                            return(true);
                        }
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            ListSupportedCulture = CommonRepository.Instance.LoadCultures(Specificulture, _context, _transaction);
            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()),
                    Options   = field["options"] != null ? field["options"].Value <JArray>() : new JArray(),
                    Priority  = field["priority"] != null ? field["priority"].Value <int>() : 0,
                    DataType  = (SWCmsConstants.DataType)(int) field["dataType"],
                    Width     = field["width"] != null ? field["width"].Value <int>() : 3,
                    IsDisplay = field["isDisplay"] != null ? field["isDisplay"].Value <bool>() : true,
                    IsSelect  = field["isSelect"] != null ? field["isSelect"].Value <bool>() : false,
                    IsGroupBy = field["isGroupBy"] != null ? field["isGroupBy"].Value <bool>() : false,
                };
                Columns.Add(thisField);
            }

            View = BETemplateViewModel.Repository.GetSingleModel(t =>
                                                                 t.TemplateId == GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0) &&
                                                                 !string.IsNullOrEmpty(this.Template) && this.Template.Contains(t.FileName + t.Extension)).Data;
            if (this.View == null)
            {
                this.View = new BETemplateViewModel(new SiocTemplate()
                {
                    Extension    = SWCmsConstants.Parameters.TemplateExtension,
                    TemplateId   = GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0),
                    TemplateName = ActivedTemplate,
                    FolderType   = TemplateFolderType,
                    FileFolder   = this.TemplateFolder,
                    FileName     = SWCmsConstants.Default.DefaultTemplate,
                    ModifiedBy   = ModifiedBy,
                    Content      = "<div></div>"
                });
            }
            this.Template = SwCmsHelper.GetFullPath(new string[]
            {
                this.View?.FileFolder
                , this.View?.FileName
            });
        }
        public IActionResult Index(string folder, IFormFile file)
        {
            if (file?.Length > 0)
            {
                folder = SwCmsHelper.GetFullPath(new string[]
                {
                    SWCmsConstants.Parameters.FileFolder,
                    folder
                });
                //string filename =
                FileRepository.Instance.SaveWebFile(file, folder);
            }
            var files       = FileRepository.Instance.GetTopFiles(folder);
            var directories = FileRepository.Instance.GetTopDirectories(folder);

            ViewData["directories"] = directories;
            ViewBag.folder          = folder;
            return(View(files));
        }
Beispiel #6
0
        public async Task <RepositoryResponse <BEMediaViewModel> > UploadAsync([FromForm] string fileFolder, [FromForm] string title, [FromForm] string description)
        {
            var files = Request.Form.Files;

            if (files.Count > 0)
            {
                var fileUpload = files.FirstOrDefault();

                string folderPath = SwCmsHelper.GetFullPath(new[] {
                    SWCmsConstants.Parameters.UploadFolder,
                    fileFolder,
                    DateTime.UtcNow.ToString("MM-yyyy")
                });
                // save web files in wwwRoot
                string uploadPath = SwCmsHelper.GetFullPath(new[] {
                    SWCmsConstants.Parameters.WebRootPath,
                    folderPath
                });

                string fileName =
                    SwCmsHelper.GetFullPath(new[] {
                    "/",
                    await UploadFileAsync(files.FirstOrDefault(), uploadPath).ConfigureAwait(false)
                });
                BEMediaViewModel media = new BEMediaViewModel(new SiocMedia()
                {
                    Specificulture  = _lang,
                    FileName        = fileName.Split('.')[0].Substring(fileName.LastIndexOf('/') + 1),
                    FileFolder      = folderPath,
                    Extension       = fileName.Substring(fileName.LastIndexOf('.')),
                    CreatedDateTime = DateTime.UtcNow,
                    FileType        = fileUpload.ContentType.Split('/')[0],
                    FileSize        = fileUpload.Length,
                    Title           = title ?? fileName.Split('.')[0].Substring(fileName.LastIndexOf('/') + 1),
                    Description     = description ?? fileName.Split('.')[0].Substring(fileName.LastIndexOf('/') + 1)
                });
                return(await media.SaveModelAsync());
            }
            else
            {
                return(new RepositoryResponse <BEMediaViewModel>());
            }
        }
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            ListSupportedCulture = GlobalLanguageService.ListSupportedCulture;
            this.ListSupportedCulture.ForEach(c => c.IsSupported =
                                                  (Id == 0 && c.Specificulture == Specificulture) ||
                                                  Repository.CheckIsExists(a => a.Id == Id && a.Specificulture == c.Specificulture, _context, _transaction)
                                              );

            if (!string.IsNullOrEmpty(this.Tags))
            {
                ListTag = JArray.Parse(this.Tags);
            }

            this.Templates = this.Templates ?? BETemplateViewModel.Repository.GetModelListBy(
                t => t.Template.Name == ActivedTemplate && t.FolderType == this.TemplateFolderType).Data;
            this.View = Templates.FirstOrDefault(t => !string.IsNullOrEmpty(this.Template) && this.Template.Contains(t.FileName + t.Extension));
            this.View = View ?? Templates.FirstOrDefault();
            if (this.View == null)
            {
                this.View = new BETemplateViewModel(new SiocTemplate()
                {
                    Extension    = SWCmsConstants.Parameters.TemplateExtension,
                    TemplateId   = GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0),
                    TemplateName = ActivedTemplate,
                    FolderType   = TemplateFolderType,
                    FileFolder   = this.TemplateFolder,
                    FileName     = SWCmsConstants.Default.DefaultTemplate,
                    ModifiedBy   = ModifiedBy,
                    Content      = "<div></div>"
                });
            }
            this.Template = SwCmsHelper.GetFullPath(new string[]
            {
                this.View?.FileFolder
                , this.View?.FileName
            });

            this.ModuleNavs   = GetModuleNavs(_context, _transaction);
            this.ParentNavs   = GetParentNavs(_context, _transaction);
            this.ChildNavs    = GetChildNavs(_context, _transaction);
            this.PositionNavs = GetPositionNavs(_context, _transaction);
        }
Beispiel #8
0
 public override SiocCmsUser ParseModel(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
 {
     if (MediaFile.FileStream != null)
     {
         MediaFile.FileFolder = SwCmsHelper.GetFullPath(new[] {
             SWCmsConstants.Parameters.UploadFolder,
             DateTime.UtcNow.ToString("MMM-yyyy")
         });;
         var isSaved = FileRepository.Instance.SaveWebFile(MediaFile);
         if (isSaved)
         {
             Avatar = MediaFile.FullPath;
         }
         else
         {
             IsValid = false;
         }
     }
     return(base.ParseModel(_context, _transaction));
 }
Beispiel #9
0
        public void UnZipFile(string fileName, string folder)
        {
            string filePath = SwCmsHelper.GetFullPath(new string[] {
                SWCmsConstants.Parameters.WebRootPath,
                folder,
                fileName
            });
            string webFolder = SwCmsHelper.GetFullPath(new string[]
            {
                SWCmsConstants.Parameters.WebRootPath,
                folder
            });

            try
            {
                ZipFile.ExtractToDirectory(filePath, webFolder);
            }
            catch
            {
                throw;
            }
        }
 public override void Validate(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
 {
     if (MediaFile?.FileStream != null)
     {
         MediaFile.FileFolder = SwCmsHelper.GetFullPath(new[] {
             SWCmsConstants.Parameters.UploadFolder,
             DateTime.UtcNow.ToString("MM-yyyy")
         });;
         var isSaved = FileRepository.Instance.SaveWebFile(MediaFile);
         if (isSaved)
         {
             Extension  = MediaFile.Extension;
             FileName   = MediaFile.Filename;
             FileFolder = MediaFile.FileFolder;
         }
         else
         {
             IsValid = false;
         }
     }
     FileType = FileType ?? "image";
     base.Validate(_context, _transaction);
 }
Beispiel #11
0
        public bool UnZipFile(FileViewModel file)
        {
            string filePath = SwCmsHelper.GetFullPath(new string[]
            {
                SWCmsConstants.Parameters.WebRootPath,
                file.FileFolder,
                $"{file.Filename}{file.Extension}"
            });
            string webFolder = SwCmsHelper.GetFullPath(new string[]
            {
                SWCmsConstants.Parameters.WebRootPath,
                file.FileFolder
            });

            try
            {
                ZipFile.ExtractToDirectory(filePath, webFolder);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            Cultures = CommonRepository.Instance.LoadCultures(Specificulture, _context, _transaction);
            this.Cultures.ForEach(c => c.IsSupported =
                                      (Id == 0 && c.Specificulture == Specificulture) ||
                                      Repository.CheckIsExists(a => a.Id == Id && a.Specificulture == c.Specificulture, _context, _transaction)
                                  );
            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()),
                    Title     = field["title"]?.ToString(),
                    Priority  = field["priority"] != null ? field["priority"].Value <int>() : 0,
                    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);
            }

            //Get Templates
            this.Templates = this.Templates ?? BETemplateViewModel.Repository.GetModelListBy(
                t => t.Template.Name == ActivedTemplate && t.FolderType == this.TemplateFolderType).Data;
            this.View = Templates.FirstOrDefault(t => !string.IsNullOrEmpty(this.Template) && this.Template.Contains(t.FileName + t.Extension));
            this.View = View ?? Templates.FirstOrDefault();
            if (this.View == null)
            {
                this.View = new BETemplateViewModel(new SiocTemplate()
                {
                    Extension    = SWCmsConstants.Parameters.TemplateExtension,
                    TemplateId   = GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0),
                    TemplateName = ActivedTemplate,
                    FolderType   = TemplateFolderType,
                    FileFolder   = this.TemplateFolder,
                    FileName     = SWCmsConstants.Default.DefaultTemplate,
                    ModifiedBy   = ModifiedBy,
                    Content      = "<div></div>"
                });
            }
            this.Template = SwCmsHelper.GetFullPath(new string[]
            {
                this.View?.FileFolder
                , this.View?.FileName
            });

            var getDataResult = InfoModuleDataViewModel.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
                                                                        , _context: _context, _transaction: _transaction
                                                                        );

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

            var getProducts = NavModuleProductViewModel.Repository.GetModelListBy(
                m => m.ModuleId == Id && m.Specificulture == Specificulture
                , SWCmsConstants.Default.OrderBy, OrderByDirection.Ascending
                , null, null
                , _context: _context, _transaction: _transaction
                );

            if (getProducts.IsSucceed)
            {
                Products = getProducts.Data;
            }
        }
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            ListSupportedCulture = CommonRepository.Instance.LoadCultures(Specificulture, _context, _transaction);
            StrNormalPrice       = SwCmsHelper.FormatPrice(NormalPrice);
            StrDealPrice         = SwCmsHelper.FormatPrice(DealPrice);
            StrImportPrice       = SwCmsHelper.FormatPrice(ImportPrice);

            if (!string.IsNullOrEmpty(this.Tags))
            {
                ListTag = JArray.Parse(this.Tags);
            }
            Properties = new List <ExtraProperty>();
            if (!string.IsNullOrEmpty(ExtraProperties))
            {
                JArray arr = JArray.Parse(ExtraProperties);
                foreach (JToken item in arr)
                {
                    Properties.Add(item.ToObject <ExtraProperty>());
                }
            }
            //Get Templates
            this.Templates = this.Templates ??
                             BETemplateViewModel.Repository.GetModelListBy(
                t => t.Template.Name == ActivedTemplate && t.FolderType == this.TemplateFolderType).Data;
            if (!string.IsNullOrEmpty(Template))
            {
                this.View = Templates.FirstOrDefault(t => Template.Contains(t.FileName));
            }
            this.View = View ?? Templates.FirstOrDefault();

            if (this.View == null)
            {
                this.View = new BETemplateViewModel(new SiocTemplate()
                {
                    Extension    = SWCmsConstants.Parameters.TemplateExtension,
                    TemplateId   = GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0),
                    TemplateName = ActivedTemplate,
                    FolderType   = TemplateFolderType,
                    FileFolder   = this.TemplateFolder,
                    FileName     = SWCmsConstants.Default.DefaultTemplate,
                    ModifiedBy   = ModifiedBy,
                    Content      = "<div></div>"
                });
            }

            this.Template = SwCmsHelper.GetFullPath(new string[]
            {
                this.View?.FileFolder
                , this.View?.FileName
            });

            var getCateProduct = CommonRepository.Instance.GetCategoryProductNav(Id, Specificulture, _context, _transaction);

            if (getCateProduct.IsSucceed)
            {
                this.Categories = getCateProduct.Data;
                this.Categories.ForEach(c =>
                {
                    c.IsActived = NavCategoryProductViewModel.Repository.CheckIsExists(n => n.CategoryId == c.CategoryId && n.ProductId == Id, _context, _transaction);
                });
            }

            var getModuleProduct = CommonRepository.Instance.GetModuleProductNav(Id, Specificulture, _context, _transaction);

            if (getModuleProduct.IsSucceed)
            {
                this.Modules = getModuleProduct.Data;
            }

            var getProductModule = CommonRepository.Instance.GetProductModuleNav(Id, Specificulture, _context, _transaction);

            if (getProductModule.IsSucceed)
            {
                this.ModuleNavs = getProductModule.Data;
            }

            var getProductMedia = NavProductMediaViewModel.Repository.GetModelListBy(n => n.ProductId == Id && n.Specificulture == Specificulture, _context, _transaction);

            if (getProductMedia.IsSucceed)
            {
                MediaNavs = getProductMedia.Data.OrderBy(p => p.Priority).ToList();
                MediaNavs.ForEach(n => n.IsActived = true);
            }

            var getRelatedProduct = NavRelatedProductViewModel.Repository.GetModelListBy(n => (n.SourceProductId == Id || n.RelatedProductId == Id) && n.Specificulture == Specificulture, _context, _transaction);

            if (getRelatedProduct.IsSucceed)
            {
                ProductNavs = getRelatedProduct.Data.OrderBy(p => p.Priority).ToList();
                ProductNavs.ForEach(n => n.IsActived = true);
            }

            this.ListSupportedCulture.ForEach(c => c.IsSupported =
                                                  (string.IsNullOrEmpty(Id) && c.Specificulture == Specificulture) ||
                                                  Repository.CheckIsExists(a => a.Id == Id && a.Specificulture == c.Specificulture, _context, _transaction)
                                              );
            this.ActivedModules = new List <BEModuleViewModel>();
            foreach (var module in this.ModuleNavs.Where(m => m.IsActived))
            {
                var getModule = BEModuleViewModel.Repository.GetSingleModel(m => m.Id == module.ModuleId && m.Specificulture == module.Specificulture, _context, _transaction);
                if (getModule.IsSucceed)
                {
                    this.ActivedModules.Add(getModule.Data);
                    this.ActivedModules.ForEach(m => m.LoadData(Id));
                }
            }
        }
Beispiel #14
0
        public override void ExpandView(SiocCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            Cultures = CommonRepository.Instance.LoadCultures(Specificulture, _context, _transaction);

            UrlAlias = ApiUrlAliasViewModel.Repository.GetSingleModel(u => u.Specificulture == Specificulture && u.SourceId == Id.ToString() && u.Type == (int)SWCmsConstants.UrlAliasType.Article).Data;
            if (UrlAlias == null)
            {
                UrlAlias = new ApiUrlAliasViewModel()
                {
                    Specificulture = Specificulture,
                    Type           = SWCmsConstants.UrlAliasType.Article,
                    Alias          = SeoName
                };
            }

            if (!string.IsNullOrEmpty(this.Tags))
            {
                ListTag = JArray.Parse(this.Tags);
            }
            Properties = new List <ExtraProperty>();
            if (!string.IsNullOrEmpty(ExtraProperties))
            {
                JArray arr = JArray.Parse(ExtraProperties);
                foreach (JToken item in arr)
                {
                    Properties.Add(item.ToObject <ExtraProperty>());
                }
            }
            //Get Templates
            int themeId = GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0);

            View = ApiTemplateViewModel.GetTemplateByPath(themeId, Template, SWCmsConstants.TemplateFolder.Articles, _context, _transaction);

            if (this.View == null)
            {
                this.View = new ApiTemplateViewModel(new SiocTemplate()
                {
                    Extension    = SWCmsConstants.Parameters.TemplateExtension,
                    TemplateId   = GlobalConfigurationService.Instance.GetLocalInt(SWCmsConstants.ConfigurationKeyword.ThemeId, Specificulture, 0),
                    TemplateName = ActivedTemplate,
                    FolderType   = TemplateFolderType,
                    FileFolder   = this.TemplateFolder,
                    FileName     = SWCmsConstants.Default.DefaultTemplate,
                    ModifiedBy   = ModifiedBy,
                    Content      = "<div></div>"
                });
            }

            this.Template = SwCmsHelper.GetFullPath(new string[]
            {
                this.View?.FileFolder
                , this.View?.FileName
            });

            var getCateArticle = CommonRepository.Instance.GetCategoryArticleNav(Id, Specificulture, _context, _transaction);

            if (getCateArticle.IsSucceed)
            {
                this.Categories = getCateArticle.Data;
                this.Categories.ForEach(c =>
                {
                    c.IsActived = NavCategoryArticleViewModel.Repository.CheckIsExists(n => n.CategoryId == c.CategoryId && n.ArticleId == Id, _context, _transaction);
                });
            }

            var getModuleArticle = CommonRepository.Instance.GetModuleArticleNav(Id, Specificulture, _context, _transaction);

            if (getModuleArticle.IsSucceed)
            {
                this.Modules = getModuleArticle.Data;
            }

            var getArticleModule = CommonRepository.Instance.GetArticleModuleNav(Id, Specificulture, _context, _transaction);

            if (getArticleModule.IsSucceed)
            {
                this.ModuleNavs = getArticleModule.Data;
            }

            var getArticleMedia = NavArticleMediaViewModel.Repository.GetModelListBy(n => n.ArticleId == Id && n.Specificulture == Specificulture, _context, _transaction);

            if (getArticleMedia.IsSucceed)
            {
                MediaNavs = getArticleMedia.Data.OrderBy(p => p.Priority).ToList();
                MediaNavs.ForEach(n => n.IsActived = true);
            }

            this.Cultures.ForEach(c => c.IsSupported =
                                      (string.IsNullOrEmpty(Id) && c.Specificulture == Specificulture) ||
                                      Repository.CheckIsExists(a => a.Id == Id && a.Specificulture == c.Specificulture, _context, _transaction)
                                  );
            this.ActivedModules = new List <ApiModuleViewModel>();
            foreach (var module in this.ModuleNavs.Where(m => m.IsActived))
            {
                var getModule = ApiModuleViewModel.Repository.GetSingleModel(m => m.Id == module.ModuleId && m.Specificulture == module.Specificulture, _context, _transaction);
                if (getModule.IsSucceed)
                {
                    this.ActivedModules.Add(getModule.Data);
                    this.ActivedModules.ForEach(m => m.LoadData(Id));
                }
            }
        }