Пример #1
0
 private void BindList()
 {
     LeaveCommentQuery query2 = new LeaveCommentQuery();
     query2.PageIndex = this.pager.PageIndex;
     LeaveCommentQuery query = query2;
     if (!string.IsNullOrEmpty(base.Request.QueryString["MessageStatus"]))
     {
         query.MessageStatus = (MessageStatus) int.Parse(base.Request.QueryString["MessageStatus"]);
         this.statusList.SelectedValue = query.MessageStatus;
     }
     DbQueryResult leaveComments = SubsiteCommentsHelper.GetLeaveComments(query);
     this.leaveList.DataSource = leaveComments.Data;
     this.leaveList.DataBind();
     this.pager.TotalRecords = leaveComments.TotalRecords;
     this.pager1.TotalRecords = leaveComments.TotalRecords;
 }
Пример #2
0
 private void BindList()
 {
     LeaveCommentQuery query = new LeaveCommentQuery();
     query.PageIndex = pager.PageIndex;
     query.PageSize = pager.PageSize;
     if (!string.IsNullOrEmpty(base.Request.QueryString["MessageStatus"]))
     {
         query.MessageStatus = (MessageStatus)int.Parse(base.Request.QueryString["MessageStatus"]);
         statusList.SelectedValue = query.MessageStatus;
     }
     DbQueryResult leaveComments = NoticeHelper.GetLeaveComments(query);
     leaveList.DataSource = leaveComments.Data;
     leaveList.DataBind();
     pager.TotalRecords = leaveComments.TotalRecords;
     pager1.TotalRecords = leaveComments.TotalRecords;
 }
Пример #3
0
 public static DbQueryResult GetLeaveComments(LeaveCommentQuery query)
 {
     return CommentProvider.Instance().GetLeaveComments(query);
 }
Пример #4
0
 static string BuildLeaveCommentQuery(LeaveCommentQuery query)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(" SELECT l.LeaveId FROM Hishop_LeaveComments l where 0=0");
     if (query.MessageStatus == MessageStatus.Replied)
     {
         builder.Append(" and (select Count(ReplyId) from Hishop_LeaveCommentReplys where LeaveId=l.LeaveId) >0 ");
     }
     if (query.MessageStatus == MessageStatus.NoReply)
     {
         builder.Append(" and (select Count(ReplyId) from Hishop_LeaveCommentReplys where LeaveId=l.LeaveId) <=0 ");
     }
     if (!string.IsNullOrEmpty(query.SortBy))
     {
         builder.AppendFormat(" ORDER BY {0} {1}", DataHelper.CleanSearchString(query.SortBy), query.SortOrder.ToString());
     }
     else
     {
         builder.Append(" ORDER BY LastDate desc");
     }
     return builder.ToString();
 }
Пример #5
0
 public override DbQueryResult GetLeaveComments(LeaveCommentQuery query)
 {
     DbQueryResult result = new DbQueryResult();
     DbCommand storedProcCommand = database.GetStoredProcCommand("cp_LeaveComments_Get");
     database.AddInParameter(storedProcCommand, "PageIndex", DbType.Int32, query.PageIndex);
     database.AddInParameter(storedProcCommand, "PageSize", DbType.Int32, query.PageSize);
     database.AddInParameter(storedProcCommand, "IsCount", DbType.Boolean, query.IsCount);
     database.AddInParameter(storedProcCommand, "sqlPopulate", DbType.String, BuildLeaveCommentQuery(query));
     database.AddOutParameter(storedProcCommand, "Total", DbType.Int32, 4);
     DataSet set = database.ExecuteDataSet(storedProcCommand);
     set.Relations.Add("LeaveCommentReplays", set.Tables[0].Columns["LeaveId"], set.Tables[1].Columns["LeaveId"], false);
     result.Data = set;
     result.TotalRecords = (int)database.GetParameterValue(storedProcCommand, "Total");
     return result;
 }
Пример #6
0
 public override DbQueryResult GetLeaveComments(LeaveCommentQuery query)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(" SELECT l.LeaveId FROM Hishop_LeaveComments l ");
     builder.Append(" WHERE IsReply = 1 ");
     builder.Append(" ORDER BY LastDate desc");
     DbQueryResult result = new DbQueryResult();
     DbCommand storedProcCommand = this.database.GetStoredProcCommand("ss_LeaveComments_Get");
     this.database.AddInParameter(storedProcCommand, "PageIndex", DbType.Int32, query.PageIndex);
     this.database.AddInParameter(storedProcCommand, "PageSize", DbType.Int32, query.PageSize);
     this.database.AddInParameter(storedProcCommand, "IsCount", DbType.Boolean, query.IsCount);
     this.database.AddInParameter(storedProcCommand, "sqlPopulate", DbType.String, builder.ToString());
     this.database.AddOutParameter(storedProcCommand, "Total", DbType.Int32, 4);
     DataSet set = this.database.ExecuteDataSet(storedProcCommand);
     set.Relations.Add("LeaveCommentReplays", set.Tables[0].Columns["LeaveId"], set.Tables[1].Columns["LeaveId"], false);
     result.Data = set;
     result.TotalRecords = (int) this.database.GetParameterValue(storedProcCommand, "Total");
     return result;
 }
Пример #7
0
 public abstract DbQueryResult GetLeaveComments(LeaveCommentQuery query);
Пример #8
0
 void BindList()
 {
     LeaveCommentQuery query = new LeaveCommentQuery();
     query.PageSize = 3;
     query.PageIndex = this.pager.PageIndex;
     DbQueryResult leaveComments = CommentBrowser.GetLeaveComments(query);
     this.rptLeaveComments.DataSource = leaveComments.Data;
     this.rptLeaveComments.DataBind();
     this.pager.TotalRecords = (int) (leaveComments.TotalRecords * (Convert.ToDouble(this.pager.PageSize) / 3.0));
 }