Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ReadSendMessage", PowerCheckType.Single);
         SendMessageSearchInfo sendMessage = new SendMessageSearchInfo();
         sendMessage.IsAdmin = 1;
         base.BindControl(SendMessageBLL.SearchSendMessageList(base.CurrentPage, base.PageSize, sendMessage, ref this.Count), this.RecordList, this.MyPager);
     }
 }
Пример #2
0
        public List <SendMessageInfo> SearchSendMessageList(SendMessageSearchInfo sendMessageSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, sendMessageSearch);
            List <SendMessageInfo> sendMessageList = new List <SendMessageInfo>();

            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) };
            pt[0].Value = mssqlCondition.ToString();
            using (SqlDataReader reader = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchSendMessageList", pt))
            {
                this.PrepareSendMessageModel(reader, sendMessageList);
            }
            return(sendMessageList);
        }
Пример #3
0
 public static List <SendMessageInfo> SearchSendMessageList(int currentPage, int pageSize, SendMessageSearchInfo sendMessage, ref int count)
 {
     return(dal.SearchSendMessageList(currentPage, pageSize, sendMessage, ref count));
 }
Пример #4
0
 public static List <SendMessageInfo> SearchSendMessageList(SendMessageSearchInfo sendMessage)
 {
     return(dal.SearchSendMessageList(sendMessage));
 }
Пример #5
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            action = RequestHelper.GetQueryString <string>("Action");
            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 8;
            int count    = 0;

            switch (action)
            {
            case "ReceiveMessage":
                ReceiveMessageSearchInfo receiveMessageSearch = new ReceiveMessageSearchInfo();
                receiveMessageSearch.UserID = base.UserID;
                receiveMessageList          = ReceiveMessageBLL.SearchReceiveMessageList(currentPage, pageSize, receiveMessageSearch, 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;
                break;

            case "SendMessage":
                SendMessageSearchInfo sendMessageSearch = new SendMessageSearchInfo();
                sendMessageSearch.UserID   = base.UserID;
                sendMessageList            = SendMessageBLL.SearchSendMessageList(currentPage, pageSize, sendMessageSearch, 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;
                break;

            case "WriteMessage":
                UserFriendSearchInfo userFriendSearch = new UserFriendSearchInfo();
                userFriendSearch.UserID = base.UserID;
                userFriendList          = UserFriendBLL.SearchUserFriendList(userFriendSearch);
                break;

            case "SearchFriend":
                SearchFriend();
                break;

            case "SendUserMessage":
                SendUserMessage();
                break;

            case "DeleteReceiveMessage":
                DeleteReceiveMessage();
                break;

            case "DeleteSendMessage":
                DeleteSendMessage();
                break;

            default:
                break;
            }
        }
Пример #6
0
        protected override void PageLoad()
        {
            base.PageLoad();
            this.action = RequestHelper.GetQueryString <string>("Action");
            int queryString = RequestHelper.GetQueryString <int>("Page");

            if (queryString < 1)
            {
                queryString = 1;
            }
            int pageSize = 8;
            int count    = 0;

            switch (this.action)
            {
            case "ReceiveMessage":
            {
                ReceiveMessageSearchInfo receiveMessage = new ReceiveMessageSearchInfo();
                receiveMessage.UserID           = base.UserID;
                this.receiveMessageList         = ReceiveMessageBLL.SearchReceiveMessageList(queryString, pageSize, receiveMessage, ref count);
                this.ajaxPagerClass.CurrentPage = queryString;
                this.ajaxPagerClass.PageSize    = pageSize;
                this.ajaxPagerClass.Count       = count;
                break;
            }

            case "SendMessage":
            {
                SendMessageSearchInfo sendMessage = new SendMessageSearchInfo();
                sendMessage.UserID              = base.UserID;
                this.sendMessageList            = SendMessageBLL.SearchSendMessageList(queryString, pageSize, sendMessage, ref count);
                this.ajaxPagerClass.CurrentPage = queryString;
                this.ajaxPagerClass.PageSize    = pageSize;
                this.ajaxPagerClass.Count       = count;
                break;
            }

            case "WriteMessage":
            {
                UserFriendSearchInfo userFriend = new UserFriendSearchInfo();
                userFriend.UserID   = base.UserID;
                this.userFriendList = UserFriendBLL.SearchUserFriendList(userFriend);
                break;
            }

            case "SearchFriend":
                this.SearchFriend();
                break;

            case "SendUserMessage":
                this.SendUserMessage();
                break;

            case "DeleteReceiveMessage":
                this.DeleteReceiveMessage();
                break;

            case "DeleteSendMessage":
                this.DeleteSendMessage();
                break;
            }
        }
Пример #7
0
 public void PrepareCondition(MssqlCondition mssqlCondition, SendMessageSearchInfo sendMessageSearch)
 {
     mssqlCondition.Add("[UserID]", sendMessageSearch.UserID, ConditionType.Equal);
     mssqlCondition.Add("[IsAdmin]", sendMessageSearch.IsAdmin, ConditionType.Equal);
 }
Пример #8
0
        public List <SendMessageInfo> SearchSendMessageList(int currentPage, int pageSize, SendMessageSearchInfo sendMessageSearch, ref int count)
        {
            List <SendMessageInfo> sendMessageList = new List <SendMessageInfo>();
            ShopMssqlPagerClass    class2          = new ShopMssqlPagerClass();

            class2.TableName   = ShopMssqlHelper.TablePrefix + "SendMessage";
            class2.Fields      = "[ID],[Title],[Content],[Date],[ToUserID],[ToUserName],[UserID],[UserName],[IsAdmin]";
            class2.CurrentPage = currentPage;
            class2.PageSize    = pageSize;
            class2.OrderField  = "[ID]";
            class2.OrderType   = OrderType.Desc;
            this.PrepareCondition(class2.MssqlCondition, sendMessageSearch);
            class2.Count = count;
            count        = class2.Count;
            using (SqlDataReader reader = class2.ExecuteReader())
            {
                this.PrepareSendMessageModel(reader, sendMessageList);
            }
            return(sendMessageList);
        }