示例#1
0
        private void GetList()
        {
            #region where
            string where = "";
            string truename = Request["truename"];
            if (!string.IsNullOrEmpty(truename))
            {
                this.TextBox_truename.Text = truename;
                where += " and truename like '%" + truename.Replace("'", "''").Replace("%", "") + "%' ";
            }
            string CompanyName = Request["CompanyName"];
            if (!string.IsNullOrEmpty(CompanyName))
            {
                this.TextBox_CompanyName.Text = CompanyName;
                where += " and CompanyName like '%" + CompanyName.Replace("'", "''").Replace("%", "") + "%' ";
            }
            string GiftName = Request["GiftName"];
            if (!string.IsNullOrEmpty(GiftName))
            {
                this.TextBox_GiftName.Text = GiftName;
                where += " and GiftName like '%" + GiftName.Replace("'", "''").Replace("%", "") + "%' ";
            }
            string phone = Request["phone"];
            if (!string.IsNullOrEmpty(phone))
            {
                this.TextBox_phone.Text = phone;
                where += " and phone like '%" + phone.Replace("'", "''").Replace("%", "") + "%' ";
            }
            string State = Request["State"];
            if (!string.IsNullOrEmpty(State))
            {
                this.DropDownList_State.SelectedValue = State;
                where += " and State = '" + State.Replace("'", "''") + "' ";
            }
            #endregion

            SOSOshop.BLL.Integral.MemberIntegralGiftExchange bll = new SOSOshop.BLL.Integral.MemberIntegralGiftExchange();
            int    pageindex = 1; int.TryParse(Request["current"], out pageindex);
            int    pagesize  = 15;
            string sort      = Request["sort"];//排序
            if (string.IsNullOrEmpty(sort) || (sort.Contains("asc") == false && sort.Contains("desc") == false))
            {
                sort = "truename ASC";
            }
            Repeater1.DataSource = bll.GetList(where, sort, pageindex, pagesize);
            Repeater1.DataBind();
            int recordcount = bll.GetListCount(where);
            page(recordcount, pageindex, pagesize);//分页
        }