protected override void PageLoad() { base.PageLoad(); if (RequestHelper.GetQueryString <string>("Action") == "AddUserMessage") { this.AddUserMessage(); } int queryString = RequestHelper.GetQueryString <int>("Page"); if (queryString < 1) { queryString = 1; } int pageSize = 3; int count = 0; UserMessageSeachInfo userMessage = new UserMessageSeachInfo(); //userMessage.UserID = base.UserID; userMessage.IsChecked = 1; this.userMessageList = UserMessageBLL.SearchUserMessageList(queryString, pageSize, userMessage, ref count); this.commonPagerClass.URL = "javascript:readUserMessage($Page);"; this.commonPagerClass.CurrentPage = queryString; this.commonPagerClass.PageSize = pageSize; this.commonPagerClass.Count = count; }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); string action = RequestHelper.GetQueryString <string>("Action"); if (action == "AddUserMessage") { AddUserMessage(); } int currentPage = RequestHelper.GetQueryString <int>("Page"); if (currentPage < 1) { currentPage = 1; } int pageSize = 15; int count = 0; UserMessageSeachInfo userMessageSeach = new UserMessageSeachInfo(); userMessageSeach.UserId = base.UserId; userMessageList = UserMessageBLL.SearchList(currentPage, pageSize, userMessageSeach, ref count); ajaxPagerClass.CurrentPage = currentPage; ajaxPagerClass.PageSize = pageSize; ajaxPagerClass.Count = count; ajaxPagerClass.FirstPage = "<<首页"; ajaxPagerClass.PreviewPage = "<<上一页"; ajaxPagerClass.NextPage = "下一页>>"; ajaxPagerClass.LastPage = "末页>>"; ajaxPagerClass.ListType = false; ajaxPagerClass.DisCount = false; ajaxPagerClass.PrenextType = true; }
/// <summary> /// 读取主题下面的多次提问 /// </summary> /// <param name="parentID"></param> /// <param name="userID"></param> /// <returns></returns> public static List <UserMessageInfo> ReadSonUserMessage(int parentID, int userID) { UserMessageSeachInfo userMessage = new UserMessageSeachInfo(); userMessage.ParentID = parentID; userMessage.UserID = userID; return(SearchUserMessageList(userMessage)); }
public void PrepareCondition(MssqlCondition mssqlCondition, UserMessageSeachInfo userMessageSearch) { mssqlCondition.Add("[MessageClass]", userMessageSearch.MessageClass, ConditionType.Equal); mssqlCondition.Add("[Title]", userMessageSearch.Title, ConditionType.Like); mssqlCondition.Add("[PostDate]", userMessageSearch.StartPostDate, ConditionType.MoreOrEqual); mssqlCondition.Add("[PostDate]", userMessageSearch.EndPostDate, ConditionType.LessOrEqual); mssqlCondition.Add("[UserName]", userMessageSearch.UserName, ConditionType.Like); mssqlCondition.Add("[UserID]", userMessageSearch.UserID, ConditionType.Equal); mssqlCondition.Add("[IsHandler]", userMessageSearch.IsHandler, ConditionType.Equal); mssqlCondition.Add("[ParentId]", userMessageSearch.ParentID, ConditionType.Equal); mssqlCondition.Add("[Mobile]", userMessageSearch.Mobile, ConditionType.Equal); mssqlCondition.Add("[IsChecked]", userMessageSearch.IsChecked, ConditionType.Equal); }
public List <UserMessageInfo> SearchList(UserMessageSeachInfo searchInfo) { using (var conn = new SqlConnection(connectString)) { string sql = "select * from UsrMessage"; string condition = PrepareCondition(searchInfo).ToString(); if (!string.IsNullOrEmpty(condition)) { sql += " where " + condition; } return(conn.Query <UserMessageInfo>(sql).ToList()); } }
public List <UserMessageInfo> SearchUserMessageList(UserMessageSeachInfo userMessageSearch) { MssqlCondition mssqlCondition = new MssqlCondition(); this.PrepareCondition(mssqlCondition, userMessageSearch); List <UserMessageInfo> userMessageList = new List <UserMessageInfo>(); SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) }; pt[0].Value = mssqlCondition.ToString(); using (SqlDataReader reader = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchUserMessageList", pt)) { this.PrepareUserMessageModel(reader, userMessageList); } return(userMessageList); }
/// <summary> /// 组合搜索条件 /// </summary> /// <param name="mssqlCondition"></param> /// <param name="userMessageSearch">UserMessageSeachInfo模型变量</param> public MssqlCondition PrepareCondition(UserMessageSeachInfo userMessageSearch) { MssqlCondition mssqlCondition = new MssqlCondition(); mssqlCondition.Add("[MessageClass]", userMessageSearch.MessageClass, ConditionType.Equal); mssqlCondition.Add("[MessageClass]", userMessageSearch.InMessageClass, ConditionType.In); mssqlCondition.Add("[Title]", userMessageSearch.Title, ConditionType.Like); mssqlCondition.Add("[PostDate]", userMessageSearch.StartPostDate, ConditionType.MoreOrEqual); mssqlCondition.Add("[PostDate]", userMessageSearch.EndPostDate, ConditionType.LessOrEqual); mssqlCondition.Add("[UserName]", userMessageSearch.UserName, ConditionType.Like); mssqlCondition.Add("[UserId]", userMessageSearch.UserId, ConditionType.Equal); mssqlCondition.Add("[IsHandler]", userMessageSearch.IsHandler, ConditionType.Equal); return(mssqlCondition); }
public List <UserMessageInfo> SearchList(int currentPage, int pageSize, UserMessageSeachInfo searchInfo, ref int count) { using (var conn = new SqlConnection(connectString)) { ShopMssqlPagerClass pc = new ShopMssqlPagerClass(); pc.TableName = "UsrMessage"; pc.Fields = "[Id], [MessageClass], [Title], [Content], [UserIP], [PostDate], [IsHandler], [AdminReplyContent], [AdminReplyDate], [UserId], [UserName],[Tel],[Email],[Gender],[Birthday],[Birthplace],[LivePlace],[Address],[Servedays],[Servemode],[AddCol1],[AddCol2] "; pc.CurrentPage = currentPage; pc.PageSize = pageSize; pc.OrderField = "[Id]"; pc.MssqlCondition = PrepareCondition(searchInfo); count = pc.Count; return(conn.Query <UserMessageInfo>(pc).ToList()); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadUserMessage", PowerCheckType.Single); classID = RequestHelper.GetQueryString <int>("MessageClass"); UserMessageSeachInfo userMessageSearch = new UserMessageSeachInfo(); userMessageSearch.MessageClass = RequestHelper.GetQueryString <int>("MessageClass"); userMessageSearch.Title = RequestHelper.GetQueryString <string>("Title"); userMessageSearch.StartPostDate = RequestHelper.GetQueryString <DateTime>("StartPostDate"); userMessageSearch.EndPostDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndPostDate")); userMessageSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); userMessageSearch.IsHandler = RequestHelper.GetQueryString <int>("IsHandler"); MessageClass.Text = RequestHelper.GetQueryString <string>("MessageClass"); Title.Text = RequestHelper.GetQueryString <string>("Title"); StartPostDate.Text = RequestHelper.GetQueryString <string>("StartPostDate"); EndPostDate.Text = RequestHelper.GetQueryString <string>("EndPostDate"); UserName.Text = RequestHelper.GetQueryString <string>("UserName"); IsHandler.Text = RequestHelper.GetQueryString <string>("IsHandler"); BindControl(UserMessageBLL.SearchList(CurrentPage, PageSize, userMessageSearch, ref Count), RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadUserMessage", PowerCheckType.Single); this.classID = RequestHelper.GetQueryString <int>("MessageClass"); UserMessageSeachInfo userMessage = new UserMessageSeachInfo(); userMessage.MessageClass = RequestHelper.GetQueryString <int>("MessageClass"); userMessage.Title = RequestHelper.GetQueryString <string>("Title"); userMessage.StartPostDate = RequestHelper.GetQueryString <DateTime>("StartPostDate"); userMessage.EndPostDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndPostDate")); userMessage.UserName = RequestHelper.GetQueryString <string>("UserName"); userMessage.IsHandler = RequestHelper.GetQueryString <int>("IsHandler"); this.MessageClass.Text = RequestHelper.GetQueryString <string>("MessageClass"); this.Title.Text = RequestHelper.GetQueryString <string>("Title"); this.StartPostDate.Text = RequestHelper.GetQueryString <string>("StartPostDate"); this.EndPostDate.Text = RequestHelper.GetQueryString <string>("EndPostDate"); this.UserName.Text = RequestHelper.GetQueryString <string>("UserName"); this.IsHandler.Text = RequestHelper.GetQueryString <string>("IsHandler"); base.BindControl(UserMessageBLL.SearchUserMessageList(base.CurrentPage, base.PageSize, userMessage, ref this.Count), this.RecordList, this.MyPager); } }
/// <summary> /// 搜索用户留言数据列表[~~~只显示允许展示案例的评论~~] /// </summary> /// <param name="currentPage">当前的页数</param> /// <param name="pageSize">每页记录数</param> /// <param name="userMessageSearch">UserMessageSeachInfo模型变量</param> /// <param name="count">总数量</param> /// <returns>用户留言数据列表</returns> public List <UserMessageInfo> SearchUserMessageList1(int currentPage, int pageSize, UserMessageSeachInfo userMessageSearch, ref int count) { List <UserMessageInfo> userMessageList = new List <UserMessageInfo>(); ShopMssqlPagerClass pc = new ShopMssqlPagerClass(); pc.TableName = "(select a.* from UsrMessage a inner join voteitem b on a.[userid]=b.id and b.[exp2]='1' union all select c.* from UsrMessage c where c.[userid]=0) as tmp"; pc.Fields = "[Id], [MessageClass], [Title], [Content], [UserIP], [PostDate], [IsHandler], [AdminReplyContent], [AdminReplyDate], [UserId], [UserName],[Tel],[Email],[Gender],[Birthday],[Birthplace],[LivePlace],[Address],[Servedays],[Servemode],[AddCol1],[AddCol2]"; pc.CurrentPage = currentPage; pc.PageSize = pageSize; pc.OrderField = "[Id]"; pc.OrderType = OrderType.Desc; PrepareCondition(userMessageSearch); //pc.Count = count; count = pc.Count; using (SqlDataReader dr = pc.ExecuteReader()) { while (dr.Read()) { UserMessageInfo userMessage = new UserMessageInfo(); userMessage.Id = dr.GetInt32(0); userMessage.MessageClass = dr.GetInt32(1); userMessage.Title = dr[2].ToString(); userMessage.Content = dr[3].ToString(); userMessage.UserIP = dr[4].ToString(); userMessage.PostDate = dr.GetDateTime(5); userMessage.IsHandler = dr.GetInt32(6); userMessage.AdminReplyContent = dr[7].ToString(); userMessage.AdminReplyDate = dr.GetDateTime(8); userMessage.UserId = dr.GetInt32(9); userMessage.UserName = dr[10].ToString(); userMessage.Email = dr[11].ToString(); userMessageList.Add(userMessage); } dr.Close(); } return(userMessageList); }
public static List <UserMessageInfo> SearchList(int currentPage, int pageSize, UserMessageSeachInfo searchInfo, ref int count) { return(dal.SearchList(currentPage, pageSize, searchInfo, ref count)); }
public static List <UserMessageInfo> SearchList(UserMessageSeachInfo searchInfo) { return(dal.SearchList(searchInfo)); }
public List <UserMessageInfo> SearchUserMessageList(int currentPage, int pageSize, UserMessageSeachInfo userMessageSearch, ref int count) { List <UserMessageInfo> userMessageList = new List <UserMessageInfo>(); ShopMssqlPagerClass class2 = new ShopMssqlPagerClass(); class2.TableName = ShopMssqlHelper.TablePrefix + "UserMessage"; class2.Fields = "[ID],[MessageClass],[Title],[Content],[UserIP],[PostDate],[IsHandler],[AdminReplyContent],[AdminReplyDate],[UserID],[UserName],[Mobile],[IsChecked]"; class2.CurrentPage = currentPage; class2.PageSize = pageSize; class2.OrderField = "[ID]"; class2.OrderType = OrderType.Desc; this.PrepareCondition(class2.MssqlCondition, userMessageSearch); class2.Count = count; count = class2.Count; using (SqlDataReader reader = class2.ExecuteReader()) { this.PrepareUserMessageModel(reader, userMessageList); } return(userMessageList); }
public static List <UserMessageInfo> SearchUserMessageList(UserMessageSeachInfo userMessage) { return(dal.SearchUserMessageList(userMessage)); }