public static string GetText(ECreateType createType) { if (createType == ECreateType.Index) { return("首页"); } else if (createType == ECreateType.Channel) { return("栏目页"); } else if (createType == ECreateType.Content) { return("内容页"); } else if (createType == ECreateType.File) { return("文件页"); } else if (createType == ECreateType.AllContent) { return("栏目下所有内容页"); } return(string.Empty); }
public static async Task ExecuteAsync(int siteId, ECreateType createType, int channelId, int contentId, int fileTemplatId, int specialId) { if (createType == ECreateType.Channel) { await CreateChannelAsync(siteId, channelId); } else if (createType == ECreateType.Content) { var siteInfo = SiteManager.GetSiteInfo(siteId); var channelInfo = ChannelManager.GetChannelInfo(siteId, channelId); await CreateContentAsync(siteInfo, channelInfo, contentId); } else if (createType == ECreateType.AllContent) { await CreateContentsAsync(siteId, channelId); } else if (createType == ECreateType.File) { await CreateFileAsync(siteId, fileTemplatId); } else if (createType == ECreateType.Special) { await CreateSpecialAsync(siteId, specialId); } }
public static string GetText(ECreateType createType) { if (createType == ECreateType.Channel) { return("栏目页"); } if (createType == ECreateType.Content) { return("内容页"); } if (createType == ECreateType.File) { return("文件页"); } if (createType == ECreateType.Special) { return("专题页"); } if (createType == ECreateType.AllContent) { return("栏目下所有内容页"); } return(string.Empty); }
public CreateTaskInfo(int id, ECreateType createType, int publishmentSystemID, int channelID, int contentID, int templateID) { ID = id; CreateType = createType; PublishmentSystemID = publishmentSystemID; ChannelID = channelID; ContentID = contentID; TemplateID = templateID; }
private static string GetTaskName(ECreateType createType, int siteId, int channelId, int contentId, int fileTemplateId, int specialId, out int pageCount) { pageCount = 0; var name = string.Empty; if (createType == ECreateType.Channel) { name = channelId == siteId ? "首页" : ChannelManager.GetChannelName(siteId, channelId); if (!string.IsNullOrEmpty(name)) { pageCount = 1; } } else if (createType == ECreateType.AllContent) { var siteInfo = SiteManager.GetSiteInfo(siteId); var channelInfo = ChannelManager.GetChannelInfo(siteId, channelId); if (channelInfo != null) { var count = ContentManager.GetCount(siteInfo, channelInfo, true); if (count > 0) { pageCount = count; name = $"{channelInfo.ChannelName}下所有内容页,共 {pageCount} 项"; } } } else if (createType == ECreateType.Content) { var tuple = DataProvider.ContentDao.GetValue(ChannelManager.GetTableName( SiteManager.GetSiteInfo(siteId), channelId), contentId, ContentAttribute.Title); if (tuple != null) { name = tuple.Item2; pageCount = 1; } } else if (createType == ECreateType.File) { name = TemplateManager.GetTemplateName(siteId, fileTemplateId); if (!string.IsNullOrEmpty(name)) { pageCount = 1; } } else if (createType == ECreateType.Special) { name = SpecialManager.GetTitle(siteId, specialId); if (!string.IsNullOrEmpty(name)) { pageCount = 1; } } return(name); }
public static ListItem GetListItem(ECreateType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public CreateTaskInfo(int id, string name, ECreateType createType, int siteId, int channelId, int contentId, int templateId, int pageCount) { Id = id; Name = name; CreateType = createType; SiteId = siteId; ChannelId = channelId; ContentId = contentId; TemplateId = templateId; PageCount = pageCount; }
public CreateTaskLogInfo(int id, ECreateType createType, int publishmentSystemID, string taskName, string timeSpan, bool isSuccess, string errorMessage, DateTime addDate) { ID = id; CreateType = createType; PublishmentSystemID = publishmentSystemID; TaskName = taskName; TimeSpan = timeSpan; IsSuccess = isSuccess; ErrorMessage = errorMessage; AddDate = addDate; }
public static bool Equals(ECreateType type, string typeStr) { if (string.IsNullOrEmpty(typeStr)) { return(false); } if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower())) { return(true); } return(false); }
public CreateTaskInfo(int id, string name, ECreateType createType, int siteId, int channelId, int contentId, int fileTemplateId, int specialId, int pageCount) { Id = id; Name = name; CreateType = createType; SiteId = siteId; ChannelId = channelId; ContentId = contentId; FileTemplateId = fileTemplateId; SpecialId = specialId; PageCount = pageCount; Executing = false; }
public CreateTaskLogInfo(int id, ECreateType createType, int siteId, int channelId, int contentId, int templateId, string taskName, string timeSpan, bool isSuccess, string errorMessage, DateTime addDate) { Id = id; CreateType = createType; SiteId = siteId; ChannelId = channelId; ContentId = contentId; TemplateId = templateId; TaskName = taskName; TimeSpan = timeSpan; IsSuccess = isSuccess; ErrorMessage = errorMessage; AddDate = addDate; }
public static string GetTaskName(ECreateType createType, int siteId, int channelId, int contentId, int templateId, out int pageCount) { pageCount = 0; var name = string.Empty; if (createType == ECreateType.Channel) { name = channelId == siteId ? "首页" : ChannelManager.GetChannelName(siteId, channelId); if (!string.IsNullOrEmpty(name)) { pageCount = 1; } } else if (createType == ECreateType.AllContent) { var nodeInfo = ChannelManager.GetChannelInfo(siteId, channelId); if (nodeInfo != null && nodeInfo.ContentNum > 0) { pageCount = nodeInfo.ContentNum; name = $"{nodeInfo.ChannelName}下所有内容页,共{pageCount}项"; } } else if (createType == ECreateType.Content) { name = DataProvider.ContentDao.GetValue( ChannelManager.GetTableName( SiteManager.GetSiteInfo(siteId), channelId), contentId, ContentAttribute.Title); if (!string.IsNullOrEmpty(name)) { pageCount = 1; } } else if (createType == ECreateType.File) { name = TemplateManager.GetTemplateName(siteId, templateId); if (!string.IsNullOrEmpty(name)) { pageCount = 1; } } return(name); }
public static string GetValue(ECreateType type) { if (type == ECreateType.Channel) { return("Channel"); } if (type == ECreateType.Content) { return("Content"); } if (type == ECreateType.File) { return("File"); } if (type == ECreateType.AllContent) { return("AllContent"); } return(string.Empty); }
//public FileSystemObject(int siteId) //{ // SiteInfo = SiteManager.GetSiteInfo(siteId); // if (SiteInfo == null) // { // throw new ArgumentException(siteId + " 不是正确的发布系统ID!"); // } // SiteId = siteInfo.Id; // SiteDir = SiteInfo.SiteDir; // SitePath = PathUtils.Combine(WebConfigUtils.PhysicalApplicationPath, SiteInfo.SiteDir); // IsRoot = SiteInfo.IsRoot; // DirectoryUtils.CreateDirectoryIfNotExists(SitePath); //} public static async Task ExecuteAsync(int siteId, ECreateType createType, int channelId, int contentId, int templateId) { if (createType == ECreateType.Channel) { await CreateChannelAsync(siteId, channelId); } else if (createType == ECreateType.Content) { var siteInfo = SiteManager.GetSiteInfo(siteId); var nodeInfo = ChannelManager.GetChannelInfo(siteId, channelId); var tableName = ChannelManager.GetTableName(siteInfo, nodeInfo); await CreateContentAsync(siteInfo, tableName, channelId, contentId); } else if (createType == ECreateType.AllContent) { await CreateContentsAsync(siteId, channelId); } else if (createType == ECreateType.File) { await CreateFileAsync(siteId, templateId); } }
public static bool Equals(string typeStr, ECreateType type) { return(Equals(type, typeStr)); }