Exemple #1
0
        protected override void Initialize()
        {
            string rawurl = Request.RawUrl;
            rawurl = We7Helper.RemoveParamFromUrl(rawurl, "keyword");
            string  qString = @"<label class=""hidden"" for=""user-search-input"">ËÑË÷{0}:</label>
                <input type=""text"" class=""search-input"" id=""KeyWord"" name=""KeyWord"" value=""""  onKeyPress=""javascript:KeyPressSearch('{1}',event);""  />
                <input type=""button"" value=""ËÑË÷"" class=""button"" id=""SearchButton""  onclick=""javascript:doSearch('{1}');""  />";
            qString = string.Format(qString, "À¸Ä¿", rawurl);
            SearchSimpleLiteral.Text = qString;

            MyChannelList = new ArrayList();
            List<Channel> allChannel = null;
            if (!string.IsNullOrEmpty(ChannelType) && ChannelType.ToString() == "link")
            {
                allChannel = ChannelHelper.GetAllLinkChannels();
            }
            else if (!string.IsNullOrEmpty(ChannelType) && ChannelType.ToString() == "article")
            {
                allChannel = ChannelHelper.GetChannelByModelName("");
            }
            else
            {
                Channel ch = ChannelHelper.GetChannel(ColumnID, null);
                string enumState = "";
                if (ch != null) enumState = ch.EnumState;
                allChannel = ChannelHelper.GetChannelsByType(enumState);
            }
            if (allChannel != null)
            {
                GetSubChannels(We7Helper.EmptyGUID, "", allChannel);
            }
            MyChannelList = FilterByKeyword();
            DetailGridView.DataSource = MyChannelList;
            DetailGridView.DataBind();
        }
Exemple #2
0
        void BindChannel()
        {
            string enumState = "";

            if (Int32.Parse(InfomationType) < 2)
            {
                enumState = "0" + InfomationType;
            }
            else
            {
                enumState = InfomationType;
            }

            //此处加载权限过滤栏目
            List <Channel> channelList = new List <Channel>();

            if (We7Helper.IsEmptyID(AccountID))
            {
                channelList = ChannelHelper.GetChannelsByType(enumState);
            }
            else
            {
                List <string> channelIds = AccountHelper.GetObjectsByPermission(AccountID, "Channel.Input");
                if (channelIds != null && channelIds.Count > 0)
                {
                    channelList = ChannelHelper.GetChannelByIDList(enumState, channelIds);
                }
            }
            List <Channel> removeList = new List <Channel>();

            foreach (Channel ch in channelList)
            {
                if (String.IsNullOrEmpty(ch.ModelName))
                {
                    continue;
                }
                if (String.Compare(ch.ModelName, "Article", true) == 0)
                {
                    continue;
                }
                if (String.Compare(ch.ModelName, "System.Article", true) == 0)
                {
                    continue;
                }
                removeList.Add(ch);
            }
            foreach (Channel ch in removeList)
            {
                channelList.Remove(ch);
            }

            if (channelList != null && channelList.Count > 0)
            {
                channelList.Sort();
                foreach (Channel ch in channelList)
                {
                    string   name  = ch.FullPath.Replace("//", "/").Replace("/", " 》");
                    string   value = ch.ID;
                    ListItem item  = new ListItem(name, value);
                    ChannelDropDownList.Items.Add(item);
                }
            }
        }