Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
        public static ListItem GetListItem(EContentModelType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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));
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 public static bool Equals(string typeStr, EContentModelType type)
 {
     return(Equals(type, typeStr));
 }
Exemplo n.º 8
0
        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);
            }
        }