/// <summary> /// 组合搜索条件 /// </summary> /// <param name="mssqlCondition"></param> /// <param name="userMessageSearch">UserPifaSeachInfo模型变量</param> public MssqlCondition PrepareCondition(OtherDuihuanSearchInfo SearchInfo) { MssqlCondition mssqlCondition = new MssqlCondition(); mssqlCondition.Add("[truename]", SearchInfo.truename, ConditionType.Like); mssqlCondition.Add("[mobile]", SearchInfo.mobile, ConditionType.Like); return(mssqlCondition); }
public List <OtherDuihuanInfo> SearchList(OtherDuihuanSearchInfo searchInfo) { using (var conn = new SqlConnection(connectString)) { string sql = "select * from OtherDuihuan"; string condition = PrepareCondition(searchInfo).ToString(); if (!string.IsNullOrEmpty(condition)) { sql += " where " + condition; } return(conn.Query <OtherDuihuanInfo>(sql).ToList()); } }
public List <OtherDuihuanInfo> SearchList(int currentPage, int pageSize, OtherDuihuanSearchInfo searchInfo, ref int count) { using (var conn = new SqlConnection(connectString)) { ShopMssqlPagerClass pc = new ShopMssqlPagerClass(); pc.TableName = "OtherDuihuan"; pc.Fields = "[id], [userid], [truename], [mobile], [note], [integral], [adminid], [addtime] "; pc.CurrentPage = currentPage; pc.PageSize = pageSize; pc.OrderField = "[id]"; pc.MssqlCondition = PrepareCondition(searchInfo); count = pc.Count; return(conn.Query <OtherDuihuanInfo>(pc).ToList()); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //CheckAdminPower("ReadPifa", PowerCheckType.Single); string action = RequestHelper.GetQueryString <string>("Action"); int id = RequestHelper.GetQueryString <int>("Id"); if (id > 0) { switch (action) { case "Delete": //CheckAdminPower("DeleteUserPifa", PowerCheckType.Single); OtherDuihuanBLL.Delete(id); AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), "兑换记录", id); break; default: break; } } OtherDuihuanSearchInfo Searchmodel = new OtherDuihuanSearchInfo(); Searchmodel.mobile = RequestHelper.GetQueryString <string>("mobile"); Searchmodel.truename = RequestHelper.GetQueryString <string>("truename"); mobile.Text = Searchmodel.mobile; truename.Text = Searchmodel.truename; PageSize = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]); var Lists = OtherDuihuanBLL.SearchList(CurrentPage, PageSize, Searchmodel, ref Count); //Count = userList.Count; AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString(); BindControl(Lists, RecordList, MyPager); } }
public static List <OtherDuihuanInfo> SearchList(int currentPage, int pageSize, OtherDuihuanSearchInfo searchInfo, ref int count) { return(dal.SearchList(currentPage, pageSize, searchInfo, ref count)); }
public static List <OtherDuihuanInfo> SearchList(OtherDuihuanSearchInfo searchInfo) { return(dal.SearchList(searchInfo)); }