public static string GetText(EContentModelType type) { if (type == EContentModelType.Content) { return("内容"); } else if (type == EContentModelType.Photo) { return("图片"); } else if (type == EContentModelType.GovPublic) { return("信息公开"); } else if (type == EContentModelType.GovInteract) { return("互动交流"); } else if (type == EContentModelType.Vote) { return("投票"); } else if (type == EContentModelType.Job) { return("招聘"); } else if (type == EContentModelType.UserDefined) { return("自定义"); } else { throw new Exception(); } }
public static string GetValue(EContentModelType type) { if (type == EContentModelType.Content) { return("Content"); } else if (type == EContentModelType.Photo) { return("Photo"); } else if (type == EContentModelType.GovPublic) { return("GovPublic"); } else if (type == EContentModelType.GovInteract) { return("GovInteract"); } else if (type == EContentModelType.Vote) { return("Vote"); } else if (type == EContentModelType.Job) { return("Job"); } else if (type == EContentModelType.UserDefined) { return("UserDefined"); } else { throw new Exception(); } }
public static ListItem GetListItem(EContentModelType type, bool selected) { var item = new ListItem(GetText(type), GetValue(type)); if (selected) { item.Selected = true; } return(item); }
public static bool Equals(EContentModelType type, string typeStr) { if (string.IsNullOrEmpty(typeStr)) { return(false); } if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower())) { return(true); } return(false); }
private static string GetContentEditUrl(EContentModelType modelType, int publishmentSystemId, int nodeId, int id, string returnUrl) { if (modelType == EContentModelType.GovPublic) { return(PageGovPublicContentAdd.GetRedirectUrlOfEdit(publishmentSystemId, nodeId, id, returnUrl)); } if (modelType == EContentModelType.Vote) { return(PageVoteContentAdd.GetRedirectUrlOfEdit(publishmentSystemId, nodeId, id, returnUrl)); } return(PageContentAdd.GetRedirectUrlOfEdit(publishmentSystemId, nodeId, id, returnUrl)); }
public static ContentModelInfo GetContentModelInfo(EPublishmentSystemType publishmentSystemType, int siteID, string tableName, EContentModelType modelType) { var modelInfo = new ContentModelInfo(); modelInfo.ModelId = GetValue(modelType); modelInfo.ModelName = GetText(modelType); modelInfo.SiteId = siteID; modelInfo.IsSystem = true; modelInfo.TableName = tableName; if (modelType == EContentModelType.Content) { modelInfo.TableType = EAuxiliaryTableType.BackgroundContent; } else if (modelType == EContentModelType.Photo) { modelInfo.TableType = EAuxiliaryTableType.BackgroundContent; modelInfo.IconUrl = "photo.gif"; } else if (modelType == EContentModelType.GovPublic) { modelInfo.TableType = EAuxiliaryTableType.GovPublicContent; modelInfo.IconUrl = "govpublic.gif"; } else if (modelType == EContentModelType.GovInteract) { modelInfo.TableType = EAuxiliaryTableType.GovInteractContent; modelInfo.IconUrl = "govinteract.gif"; } else if (modelType == EContentModelType.Vote) { modelInfo.TableType = EAuxiliaryTableType.VoteContent; modelInfo.IconUrl = "vote.gif"; } else if (modelType == EContentModelType.Job) { modelInfo.TableType = EAuxiliaryTableType.JobContent; modelInfo.IconUrl = "job.gif"; } return(modelInfo); }
public static bool Equals(string typeStr, EContentModelType type) { return(Equals(type, typeStr)); }
public static void AddListItems(ListItemCollection listItemCollection, PublishmentSystemInfo publishmentSystemInfo, bool isSeeOwning, bool isShowContentNum, bool isShowContentModel, EContentModelType contentModel, string administratorName) { var list = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(publishmentSystemInfo.PublishmentSystemId); var nodeCount = list.Count; var isLastNodeArray = new bool[nodeCount]; foreach (var nodeId in list) { var enabled = true; if (isSeeOwning) { enabled = AdminUtility.IsOwningNodeId(administratorName, nodeId); if (!enabled) { if (!AdminUtility.IsHasChildOwningNodeId(administratorName, nodeId)) { continue; } } } var nodeInfo = GetNodeInfo(publishmentSystemInfo.PublishmentSystemId, nodeId); var listitem = new ListItem(GetSelectText(publishmentSystemInfo, nodeInfo, isLastNodeArray, isShowContentNum, isShowContentModel), nodeInfo.NodeId.ToString()); if (!enabled) { listitem.Attributes.Add("style", "color:gray;"); } if (nodeInfo.ContentModelId != contentModel.ToString()) { listitem.Attributes.Add("disabled", "disabled"); } listItemCollection.Add(listitem); } }