public DbQueryResult DistributorGradeCommission(DistributorGradeCommissionQuery query)
        {
            string        table   = "vw_Hishop_DistributorGradeCommission";
            StringBuilder builder = new StringBuilder();

            if (!string.IsNullOrEmpty(query.Title))
            {
                builder.AppendFormat(" StoreName LIKE '%{0}%' ", DataHelper.CleanSearchString(query.Title));
            }
            if (query.StartTime.HasValue)
            {
                if (!string.IsNullOrEmpty(builder.ToString()))
                {
                    builder.Append(" AND ");
                }
                builder.AppendFormat(" PubTime>='{0}' ", query.StartTime.Value.ToString("yyyy-MM-dd"));
            }
            if (query.EndTime.HasValue)
            {
                if (!string.IsNullOrEmpty(builder.ToString()))
                {
                    builder.Append(" AND ");
                }
                builder.AppendFormat(" PubTime<'{0}' ", query.EndTime.Value.AddDays(1.0).ToString("yyyy-MM-dd"));
            }
            return(DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, table, "ID", (builder.Length > 0) ? builder.ToString() : null, "*"));
        }
        private void BindData(int pageno, int sendtype)
        {
            DistributorGradeCommissionQuery entity = new DistributorGradeCommissionQuery
            {
                SortBy    = "ID",
                SortOrder = SortAction.Desc
            };

            Globals.EntityCoding(entity, true);
            entity.PageIndex = pageno;
            entity.PageSize  = this.pager.PageSize;
            string str  = Globals.RequestQueryStr("starttime");
            string str2 = Globals.RequestQueryStr("endtime");
            string str3 = Globals.RequestQueryStr("title");

            if (!string.IsNullOrEmpty(str3))
            {
                entity.Title     = str3;
                this.txtKey.Text = str3;
            }
            try
            {
                if (!string.IsNullOrEmpty(str))
                {
                    entity.StartTime            = new DateTime?(DateTime.Parse(str));
                    this.calendarStartDate.Text = entity.StartTime.Value.ToString("yyyy-MM-dd");
                }
                if (!string.IsNullOrEmpty(str2))
                {
                    entity.EndTime            = new DateTime?(DateTime.Parse(str2));
                    this.calendarEndDate.Text = entity.EndTime.Value.ToString("yyyy-MM-dd");
                }
            }
            catch
            {
            }
            DbQueryResult result = DistributorGradeCommissionHelper.DistributorGradeCommission(entity);

            this.rptList.DataSource = result.Data;
            this.rptList.DataBind();
            int totalRecords = result.TotalRecords;

            this.pager.TotalRecords = totalRecords;
            this.recordcount        = totalRecords;
            if (this.pager.TotalRecords <= this.pager.PageSize)
            {
                this.pager.Visible = false;
            }
        }
        private void BindData(int pageno, int sendtype)
        {
            DistributorGradeCommissionQuery distributorGradeCommissionQuery = new DistributorGradeCommissionQuery();

            distributorGradeCommissionQuery.SortBy    = "ID";
            distributorGradeCommissionQuery.SortOrder = SortAction.Desc;
            Globals.EntityCoding(distributorGradeCommissionQuery, true);
            distributorGradeCommissionQuery.PageIndex = pageno;
            distributorGradeCommissionQuery.PageSize  = this.pager.PageSize;
            string text  = Globals.RequestQueryStr("starttime");
            string text2 = Globals.RequestQueryStr("endtime");
            string text3 = Globals.RequestQueryStr("title");

            if (!string.IsNullOrEmpty(text3))
            {
                distributorGradeCommissionQuery.Title = text3;
                this.txtKey.Text = text3;
            }
            try
            {
                if (!string.IsNullOrEmpty(text))
                {
                    distributorGradeCommissionQuery.StartTime = new System.DateTime?(System.DateTime.Parse(text));
                    this.calendarStartDate.Text = distributorGradeCommissionQuery.StartTime.Value.ToString("yyyy-MM-dd");
                }
                if (!string.IsNullOrEmpty(text2))
                {
                    distributorGradeCommissionQuery.EndTime = new System.DateTime?(System.DateTime.Parse(text2));
                    this.calendarEndDate.Text = distributorGradeCommissionQuery.EndTime.Value.ToString("yyyy-MM-dd");
                }
            }
            catch
            {
            }
            DbQueryResult dbQueryResult = DistributorGradeCommissionHelper.DistributorGradeCommission(distributorGradeCommissionQuery);

            this.rptList.DataSource = dbQueryResult.Data;
            this.rptList.DataBind();
            int totalRecords = dbQueryResult.TotalRecords;

            this.pager.TotalRecords = totalRecords;
            this.recordcount        = totalRecords;
            if (this.pager.TotalRecords <= this.pager.PageSize)
            {
                this.pager.Visible = false;
            }
        }
 public static DbQueryResult DistributorGradeCommission(DistributorGradeCommissionQuery query)
 {
     return(new DistributorGradeCommissionDao().DistributorGradeCommission(query));
 }