Пример #1
0
        protected void BindList()
        {
            enable = WS.RequestInt("enable", -1);
            group  = WS.RequestInt("group", -1);
            url    = string.Format("UserList.aspx?ebable={0}&group={1}", enable.ToString(), group.ToString());


            ddl_Group.DataSource     = UserAction.GetUserGroups();
            ddl_Group.DataTextField  = "GroupName";
            ddl_Group.DataValueField = "ID";
            ddl_Group.DataBind();
            ddl_Group.Items.Add(new ListItem("--不限--", ""));
            ddl_Group.SelectedValue = "";

            if (group > -1)
            {
                ddl_Group.SelectedValue = group.ToS();
                ddl_Group.Enabled       = false;
            }
            if (enable > -1)
            {
                ddl_Enabled.SelectedValue = enable.ToS();
                ddl_Enabled.Enabled       = false;
            }

            pager.PageSize = SystemSetting.MagageListSize;


            string str_sql = "";

            if (!ddl_Group.SelectedValue.IsNullOrEmpty())
            {
                str_sql += "[Group]=" + ddl_Group.SelectedValue;
            }
            if (!ddl_Enabled.SelectedValue.IsNullOrEmpty())
            {
                if (!str_sql.Trim().IsNullOrEmpty())
                {
                    str_sql += " and ";
                }
                str_sql += "Enable=" + ddl_Enabled.SelectedValue;
            }

            ph p = new ph();

            p.CurrentPage = pager.CurrentPageIndex;
            p.Fields      = "ID, UserName, UserPass, Email, ChineseName, QQ, MSN, Tel, Mobile, WebSite, Image, Address, ZipCode, Intro, RegTime, RegIP, LoginCount, LastLoginTime, LastLoginIP, Cent, PostCount, GTalk, Twitter, weibo, ICQ, [Group],enable";
            p.Filter      = str_sql;
            p.group       = "";
            p.PageSize    = pager.PageSize;
            p.PrimaryKey  = "ID";
            p.Sort        = "ID desc";
            p.Tables      = "[User]";

            pager.RecordCount = p.Count();

            rp_list.DataSource = p.GetTable();
            rp_list.DataBind();
        }
Пример #2
0
        /// <summary>
        /// 加载列表
        /// </summary>
        protected void LoadList()
        {
            pager.PageSize = SystemSetting.MagageListSize;

            ph p = new ph()
            {
                Tables      = "SysUser",
                PrimaryKey  = "ID",
                Sort        = "ID desc",
                CurrentPage = pager.CurrentPageIndex,
                PageSize    = pager.PageSize,
                Fields      = "ID, UserName, UserPass, Logincount, LastLoginTime, LastLoginIP, SafeQuestion, SafeAnswer, Department, ChineseName, UserGroup, Email, TelNumber, Enabled",
                Filter      = "",
                group       = ""
            };

            rp_list.DataSource = p.GetTable();
            rp_list.DataBind();
            pager.RecordCount = p.Count();
        }
Пример #3
0
        /// <summary>
        /// 加载列表
        /// </summary>
        protected void LoadInfo()
        {
            pager.PageSize = SystemSetting.MagageListSize;

            ddl_Class.DataSource     = NewsAction.NewsClass.Where(pa => pa.IsLeafClass && pa.ModelID == 1).ToList();
            ddl_Class.DataTextField  = "ClassName";
            ddl_Class.DataValueField = "ID";
            ddl_Class.DataBind();
            ddl_Class.Items.Add(new ListItem("--所有栏目--", ""));
            ddl_Class.SelectedValue = "";



            ddl_Zt.DataSource     = NewsAction.NewsZt;
            ddl_Zt.DataTextField  = "ZtName";
            ddl_Zt.DataValueField = "ID";
            ddl_Zt.DataBind();
            ddl_Zt.Items.Add(new ListItem("--所有专题--", ""));
            //ddl_Zt.SelectedValue = "";


            ddl_Class_search.DataSource     = NewsAction.NewsClass.Where(pa => pa.IsLeafClass && pa.ModelID == 1).ToList();
            ddl_Class_search.DataTextField  = "ClassName";
            ddl_Class_search.DataValueField = "ID";
            ddl_Class_search.DataBind();
            ddl_Class_search.Items.Add(new ListItem("--新增请选择栏目--", ""));
            ddl_Class_search.SelectedValue = "";

            if (WS.RequestInt("class") > 0)
            {
                ddl_Class_search.SelectedValue = WS.RequestString("class");
                ddl_Class.SelectedValue        = WS.RequestString("class");
            }

            string str_sql = "";

            if (ddl_Prop.SelectedValue != "")
            {
                switch (ddl_Prop.SelectedValue)
                {
                case "SetTop":
                    str_sql += "SetTop=1 ";
                    break;

                case "Tuijian":
                    str_sql += "Tuijian=1 ";
                    break;

                case "Toutiao":
                    str_sql += "Toutiao=1 ";
                    break;

                case "Audit":
                    str_sql += "Audit=1";
                    break;

                case "UnAudit":
                    str_sql += "Audit=0";
                    break;
                }
            }

            if (txt_Key.Text.Trim().Length > 0 && txt_Column.SelectedValue != "")
            {
                if (str_sql.Trim().Length > 0)
                {
                    str_sql += " and ";
                }
                str_sql += txt_Column.SelectedValue + " like '%" + txt_Key.Text + "%'";
            }

            if (ddl_Class.SelectedValue != "")
            {
                if (str_sql.Trim().Length > 0)
                {
                    str_sql += " and ";
                }
                str_sql += "ClassID=" + ddl_Class.SelectedValue;;
            }

            if (cls > 0)
            {
                if (str_sql.Trim().Length > 0)
                {
                    str_sql += " and ";
                }
                str_sql += "ClassID=" + cls;
                //ddl_Class_search.Visible = false;
                ddl_Class_search.Enabled = false;
                ddl_Class.Enabled        = false;
            }
            if (ddl_Class_search.SelectedValue != "")
            {
                if (str_sql.Trim().Length > 0)
                {
                    str_sql += " and ";
                }
                str_sql += "ClassID=" + ddl_Class_search.SelectedValue;
            }

            if (zt > 0)
            {
                if (str_sql.Trim().Length > 0)
                {
                    str_sql += " and ";
                }
                str_sql += "ZtID=" + zt;
            }

            //str_sql += "order by " + ddl_Order.SelectedValue + " " + ddl_Desc.SelectedValue;

            ph p = new ph();

            p.CurrentPage = pager.CurrentPageIndex;
            p.Fields      = "*";
            p.Filter      = str_sql;
            p.group       = "";
            p.PageSize    = pager.PageSize;
            p.PrimaryKey  = "ID";
            p.Sort        = ddl_Order.SelectedValue + " " + ddl_Desc.SelectedValue;
            p.Tables      = "News";

            rp_list.DataSource = p.GetTable();
            pager.RecordCount  = p.Count();
            rp_list.DataBind();
        }