Beispiel #1
0
        public static UpdateViewModel GetDefault(MixEnums.EnumTemplateFolder folderType, string specificulture
                                                 , MixCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            string activedTheme = MixService.GetConfig <string>(MixAppSettingKeywords.ThemeFolder, specificulture)
                                  ?? MixService.GetConfig <string>(MixAppSettingKeywords.DefaultTheme);
            string folder = CommonHelper.GetFullPath(new string[]
            {
                MixFolders.TemplatesFolder
                , activedTheme
                , folderType.ToString()
            });
            var defaulTemplate = MixTemplates.UpdateViewModel.Repository.GetModelListBy(
                t => t.Theme.Name == activedTheme && t.FolderType == folderType.ToString()
                , _context, _transaction
                ).Data?.FirstOrDefault();

            return(defaulTemplate ?? new UpdateViewModel(new MixTemplate()
            {
                ThemeId = MixService.GetConfig <int>(MixAppSettingKeywords.ThemeId, specificulture),
                ThemeName = MixService.GetConfig <string>(MixAppSettingKeywords.ThemeFolder, specificulture),
                FileName = MixService.GetConfig <string>(MixAppSettingKeywords.DefaultTemplate),
                Extension = MixService.GetConfig <string>(MixAppSettingKeywords.TemplateExtension),
                Content = MixService.GetConfig <string>(MixAppSettingKeywords.DefaultTemplateContent),
                FolderType = folderType.ToString(),
                FileFolder = folder.ToString()
            }));
        }
Beispiel #2
0
		public static UpdateViewModel GetDefault(MixEnums.EnumTemplateFolder folderType, string specificulture)
		{
			// 
			// Current member / type: Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel::GetDefault(Mix.Cms.Lib.MixEnums/EnumTemplateFolder,System.String)
			// Exception in: Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel GetDefault(Mix.Cms.Lib.MixEnums/EnumTemplateFolder,System.String)
			// Object reference not set to an instance of an object.
			// 
			// mailto: [email protected]

		}
Beispiel #3
0
        public static UpdateViewModel GetDefault(MixEnums.EnumTemplateFolder folderType, string specificulture)
        {
            string activedTheme = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.Theme, specificulture)
                                  ?? MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.DefaultTheme);
            string folder = CommonHelper.GetFullPath(new string[]
            {
                MixConstants.Folder.TemplatesFolder
                , activedTheme
                , folderType.ToString()
            });

            return(new UpdateViewModel(new MixTemplate()
            {
                ThemeId = MixService.GetConfig <int>(MixConstants.ConfigurationKeyword.ThemeId, specificulture),
                ThemeName = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.Theme, specificulture),
                FileName = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.DefaultTemplate),
                Extension = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.TemplateExtension),
                Content = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.DefaultTemplateContent),
                FolderType = folderType.ToString(),
                FileFolder = folder.ToString()
            }));
        }
Beispiel #4
0
        public static ImportViewModel GetDefault(MixEnums.EnumTemplateFolder folderType, string specificulture)
        {
            string activedTheme = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.ThemeFolder, specificulture)
                                  ?? MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.DefaultTheme);
            string folder = CommonHelper.GetFullPath(new string[]
            {
                MixConstants.Folder.TemplatesFolder
                , activedTheme
                , folderType.ToString()
            });
            var defaulTemplate = MixTemplates.ImportViewModel.Repository.GetModelListBy(
                t => t.Theme.Name == activedTheme && t.FolderType == folderType.ToString()).Data?.FirstOrDefault();

            return(defaulTemplate ?? new ImportViewModel(new MixTemplate()
            {
                ThemeId = MixService.GetConfig <int>(MixConstants.ConfigurationKeyword.ThemeId, specificulture),
                ThemeName = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.ThemeFolder, specificulture),
                FileName = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.DefaultTemplate),
                Extension = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.TemplateExtension),
                Content = MixService.GetConfig <string>(MixConstants.ConfigurationKeyword.DefaultTemplateContent),
                FolderType = folderType.ToString(),
                FileFolder = folder.ToString()
            }));
        }
Beispiel #5
0
        public static UpdateViewModel GetTemplateByPath(string path, string specificulture, MixEnums.EnumTemplateFolder folderType, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            string templateName = path?.Split('/')[1];
            int    themeId      = MixService.GetConfig <int>(MixConstants.ConfigurationKeyword.ThemeId, specificulture);
            var    getView      = UpdateViewModel.Repository.GetSingleModel(t =>
                                                                            t.ThemeId == themeId && t.FolderType == folderType.ToString() &&
                                                                            !string.IsNullOrEmpty(templateName) && templateName.Equals($"{t.FileName}{t.Extension}"), _context, _transaction);

            return(getView.Data ?? GetDefault(folderType, specificulture));
        }
Beispiel #6
0
				V_2 = Expression.Parameter(Type.GetTypeFromHandle(// 
				// Current member / type: Mix.Domain.Core.ViewModels.RepositoryResponse`1<Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel> Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel::GetTemplateByPath(System.String,System.String,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Exception in: Mix.Domain.Core.ViewModels.RepositoryResponse<Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel> GetTemplateByPath(System.String,System.String,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Specified method is not supported.
				// 
				// mailto: [email protected]


		public static UpdateViewModel GetTemplateByPath(string path, string specificulture, MixEnums.EnumTemplateFolder folderType, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			V_0 = new UpdateViewModel.u003cu003ec__DisplayClass93_0();
			V_0.folderType = folderType;
			stackVariable3 = V_0;
			if (path != null)
			{
				stackVariable10 = path.Split('/', 0)[1];
			}
			else
			{
				stackVariable10 = null;
			}
			stackVariable3.templateName = stackVariable10;
			V_0.themeId = MixService.GetConfig<int>("ThemeId", specificulture);
			dummyVar0 = MixService.GetConfig<string>("ThemeName", specificulture);
			stackVariable18 = ViewModelBase<MixCmsContext, MixTemplate, UpdateViewModel>.Repository;
			V_1 = Expression.Parameter(Type.GetTypeFromHandle(// 
Beispiel #7
0
        public static UpdateViewModel GetTemplateByPath(string path, string specificulture, MixEnums.EnumTemplateFolder folderType
                                                        , MixCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            string templateName = !string.IsNullOrEmpty(path) ? path.Substring(path.LastIndexOf('/') + 1) : null;
            string filename     = templateName?.Substring(0, templateName.LastIndexOf('.'));
            string ext          = templateName?.Substring(templateName.LastIndexOf('.'));
            int    themeId      = MixService.GetConfig <int>(MixAppSettingKeywords.ThemeId, specificulture);
            string themeName    = MixService.GetConfig <string>(MixAppSettingKeywords.ThemeName, specificulture);
            var    getView      = UpdateViewModel.Repository.GetSingleModel(t =>
                                                                            t.ThemeId == themeId && t.FolderType == folderType.ToString() &&
                                                                            !string.IsNullOrEmpty(templateName) && t.FileName == filename && t.Extension == ext
                                                                            , _context, _transaction);

            return(getView.Data ?? GetDefault(folderType, specificulture, _context, _transaction));
        }