コード例 #1
0
ファイル: DataControlList.aspx.cs プロジェクト: jiaping/JPCMS
        void BindData()
        {
            List <DataControlInfo> result = DataControlHelper.GetDataControlsInfos();

            if (ddlType.SelectedValue != "ALL")
            {
                result = result.FindAll(delegate(DataControlInfo dci)
                {
                    return(dci.Group == ddlType.SelectedValue && (dci.Name.Contains(txtKeyWord.Text.Trim()) || dci.Desc.Contains(txtKeyWord.Text.Trim())));
                });
            }
            else
            {
                result = result.FindAll(delegate(DataControlInfo dci)
                {
                    return(dci.Name.Contains(txtKeyWord.Text.Trim()) || dci.Desc.Contains(txtKeyWord.Text.Trim()));
                });
            }
            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = result;
            pds.PageSize         = Pager.PageSize;
            pds.AllowPaging      = true;
            Pager.RecordCount    = result.Count;
            pds.CurrentPageIndex = Pager.CurrentPageIndex - 1;

            if (pds.CurrentPageIndex < 0)
            {
                pds.CurrentPageIndex = 0;
            }
            ModeDataList.DataSource = pds;
            ModeDataList.DataBind();
        }
コード例 #2
0
        protected void Sort(string sortName)
        {
            string sortText           = sortName;
            List <DataControlInfo> ds = DataControlHelper.GetControls(sortName);

            ModeDataList.DataSource = ds;
            ModeDataList.DataBind();

            if (ds.Count == 0)
            {
                ShowMessage("没有符合条件的控件。");
            }
            else
            {
                ShowMessage(String.Format("总共 {0} 个控件。", ds.Count));
            }
        }
コード例 #3
0
        protected override void Initialize()
        {
            string selectQuery        = this.FieldDropDownList.SelectedItem.ToString();
            string query              = SearchTextBox.Text.Trim();
            List <DataControlInfo> ds = DataControlHelper.GetControls(query, selectQuery);

            ModeDataList.DataSource = ds;
            ModeDataList.DataBind();

            if (ds.Count == 0)
            {
                ShowMessage("没有符合条件的控件。");
            }
            else
            {
                ShowMessage(String.Format("总共 {0} 个控件。", ds.Count));
            }
        }
コード例 #4
0
        void BindData()
        {
            BaseControlHelper      Helper   = new BaseControlHelper();
            List <DataControlInfo> infoList = Helper.GetDataControlsInfos();
            List <DataControlInfo> result   = new List <DataControlInfo>();

            if (result != null)
            {
                if (ddlType.SelectedValue != "ALL")
                {
                    foreach (DataControlInfo dci in infoList)
                    {
                        if (!result.Contains(dci) && dci.Group == ddlType.SelectedValue && (dci.Name.Contains(txtKeyWord.Text.Trim()) || dci.Desc.Contains(txtKeyWord.Text.Trim()) || dci.DefaultControl.Description.Contains(txtKeyWord.Text.Trim())))
                        {
                            result.Add(dci);
                        }
                    }
                }
                else
                {
                    foreach (DataControlInfo dci in infoList)
                    {
                        if (!result.Contains(dci) && (dci.Name.Contains(txtKeyWord.Text.Trim()) || dci.Desc.Contains(txtKeyWord.Text.Trim())))
                        {
                            result.Add(dci);
                        }
                    }
                }
                PagedDataSource pds = new PagedDataSource();
                pds.DataSource       = result;
                pds.PageSize         = Pager.PageSize;
                pds.AllowPaging      = true;
                Pager.RecordCount    = result.Count;
                pds.CurrentPageIndex = Pager.CurrentPageIndex - 1;

                if (pds.CurrentPageIndex < 0)
                {
                    pds.CurrentPageIndex = 0;
                }
                ModeDataList.DataSource = pds;
                ModeDataList.DataBind();
            }
        }
コード例 #5
0
ファイル: DataControlList.aspx.cs プロジェクト: jiaping/JPCMS
        protected void Sort(string sortName)
        {
            string sortText = sortName;

            DataControl[] ds = TemplateHelper.SortDataControls(sortText);

            DetailGridView.DataSource = ds;
            DetailGridView.DataBind();

            ModeDataList.DataSource = ds;
            ModeDataList.DataBind();

            if (ds.Length == 0)
            {
                ShowMessage("没有符合条件的控件。");
            }
            else
            {
                ShowMessage(String.Format("总共 {0} 个控件。", ds.Length));
            }
        }
コード例 #6
0
ファイル: DataControlList.aspx.cs プロジェクト: jiaping/JPCMS
        protected override void Initialize()
        {
            string selectQuery = this.FieldDropDownList.SelectedItem.ToString();
            string query       = SearchTextBox.Text;

            DataControl[] ds = TemplateHelper.GetDataControls(query, selectQuery);

            DetailGridView.DataSource = ds;
            DetailGridView.DataBind();

            ModeDataList.DataSource = ds;
            ModeDataList.DataBind();

            if (ds.Length == 0)
            {
                ShowMessage("没有符合条件的控件。");
            }
            else
            {
                ShowMessage(String.Format("总共 {0} 个控件。", ds.Length));
            }
        }