Пример #1
0
 private void BindData()
 {
     int num;
     ReceivedMessageQuery query2 = new ReceivedMessageQuery();
     query2.PageIndex = this.pager.PageIndex;
     query2.PageSize = this.pager.PageSize;
     query2.SortBy = this.messagesList.SortOrderBy;
     query2.UserName = HiContext.Current.User.Username;
     ReceivedMessageQuery query = query2;
     if (!string.IsNullOrEmpty(base.Request.QueryString["MessageStatus"]))
     {
         query.MessageStatus = (MessageStatus) int.Parse(base.Request.QueryString["MessageStatus"]);
         this.statusList.SelectedValue = query.MessageStatus;
     }
     if (int.TryParse(base.Request.QueryString["IsRead"], out num))
     {
         query.IsRead = new bool?(Convert.ToBoolean(num));
     }
     if (this.messagesList.SortOrder.ToLower() == "desc")
     {
         query.SortOrder = SortAction.Desc;
     }
     DbQueryResult receivedMessages = SubsiteCommentsHelper.GetReceivedMessages(query);
     this.messagesList.DataSource = receivedMessages.Data;
     this.messagesList.DataBind();
     this.pager.TotalRecords = receivedMessages.TotalRecords;
     this.pager1.TotalRecords = receivedMessages.TotalRecords;
 }
        private void BindData()
        {
            int num;
            ReceivedMessageQuery query = new ReceivedMessageQuery();
            query.PageIndex = pager.PageIndex;
            query.PageSize = pager.PageSize;
            query.SortBy = messagesList.SortOrderBy;

            if (!string.IsNullOrEmpty(base.Request.QueryString["MessageStatus"]))
            {
                query.MessageStatus = (MessageStatus)int.Parse(base.Request.QueryString["MessageStatus"]);
                statusList.SelectedValue = query.MessageStatus;
            }
            if (int.TryParse(base.Request.QueryString["IsRead"], out num))
            {
                query.IsRead = new bool?(Convert.ToBoolean(num));
            }
            query.UserName = "******";
            if (messagesList.SortOrder.ToLower() == "desc")
            {
                query.SortOrder = SortAction.Desc;
            }
            DbQueryResult distributorReceivedMessages = NoticeHelper.GetDistributorReceivedMessages(query);
            messagesList.DataSource = distributorReceivedMessages.Data;
            messagesList.DataBind();
            pager.TotalRecords = distributorReceivedMessages.TotalRecords;
            pager1.TotalRecords = distributorReceivedMessages.TotalRecords;
        }
Пример #3
0
 void BindData()
 {
     ReceivedMessageQuery query = new ReceivedMessageQuery();
     query.PageIndex = this.pager.PageIndex;
     query.PageSize = this.pager.PageSize;
     query.UserName = HiContext.Current.User.Username;
     DbQueryResult receivedMessages = CommentsHelper.GetReceivedMessages(query);
     if (((DataTable) receivedMessages.Data).Rows.Count <= 0)
     {
         query.PageIndex = this.messagesList.PageIndex - 1;
         receivedMessages = CommentsHelper.GetReceivedMessages(query);
         this.messagesList.DataSource = receivedMessages.Data;
     }
     this.messagesList.DataSource = receivedMessages.Data;
     this.messagesList.DataBind();
     this.pager.TotalRecords = receivedMessages.TotalRecords;
 }
Пример #4
0
 public override DbQueryResult GetReceivedMessages(ReceivedMessageQuery query)
 {
     string filter = string.Format("Addressee='{0}'", query.UserName);
     if (query.MessageStatus == MessageStatus.NoReply)
     {
         filter = filter + " AND ReceiveMessageId NOT IN(SELECT ISNULL(ReceiveMessageId,-1) FROM Hishop_SendedMessages)";
     }
     if (query.MessageStatus == MessageStatus.Replied)
     {
         filter = filter + " AND ReceiveMessageId IN(SELECT ReceiveMessageId FROM Hishop_SendedMessages)";
     }
     if (query.IsRead.HasValue)
     {
         filter = filter + string.Format("AND IsRead = {0} ", query.IsRead.Value ? "1" : "0");
     }
     filter = filter + " AND Addresser IN (SELECT UserName FROM  vw_aspnet_Members)";
     return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "Hishop_ReceivedMessages", "ReceiveMessageId", filter, "*");
 }
Пример #5
0
 public override DbQueryResult GetReceivedMessages(ReceivedMessageQuery query)
 {
     return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "Hishop_ReceivedMessages", "ReceiveMessageId", string.Format("Addressee='{0}'", query.UserName), "*");
 }
Пример #6
0
 public static DbQueryResult GetDistributorReceivedMessages(ReceivedMessageQuery query)
 {
     return CommentsProvider.Instance().GetDistributorReceivedMessages(query);
 }
Пример #7
0
 public abstract DbQueryResult GetDistributorReceivedMessages(ReceivedMessageQuery query);
Пример #8
0
 public abstract DbQueryResult GetReceivedMessages(ReceivedMessageQuery query);
Пример #9
0
 public static DbQueryResult GetReceivedMessagesToAdmin(ReceivedMessageQuery query)
 {
     return SubsiteCommentsProvider.Instance().GetReceivedMessagesToAdmin(query);
 }
Пример #10
0
 public static DbQueryResult GetReceivedMessages(ReceivedMessageQuery query)
 {
     return CommentDataProvider.Instance().GetReceivedMessages(query);
 }