コード例 #1
0
        public DbQueryResult GetDistributorGrade(DistributorGradeQuery query)
        {
            StringBuilder builder = new StringBuilder();

            if (query.GradeId > 0)
            {
                if (builder.Length > 0)
                {
                    builder.Append(" AND ");
                }
                builder.AppendFormat(" GradeId = {0}", query.GradeId);
            }
            if (!string.IsNullOrEmpty(query.Name))
            {
                if (builder.Length > 0)
                {
                    builder.Append(" AND ");
                }
                builder.AppendFormat(" Name LIKE '%{0}%'", DataHelper.CleanSearchString(query.Name));
            }
            if (!string.IsNullOrEmpty(query.Description))
            {
                if (builder.Length > 0)
                {
                    builder.Append(" AND ");
                }
                builder.AppendFormat(" Description LIKE '%{0}%'", DataHelper.CleanSearchString(query.Description));
            }
            return(DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "aspnet_DistributorGrade", "GradeID", (builder.Length > 0) ? builder.ToString() : null, "*"));
        }
コード例 #2
0
        private void BindDistributorGrade()
        {
            DistributorGradeQuery entity = new DistributorGradeQuery
            {
                Name      = this.m_txtName,
                SortBy    = "GradeID",
                SortOrder = SortAction.Asc
            };

            Globals.EntityCoding(entity, true);
            entity.PageIndex = this.pager.PageIndex;
            entity.PageSize  = this.pager.PageSize;
            DbQueryResult distributorGradeRequest = DistributorGradeBrower.GetDistributorGradeRequest(entity);

            this.rptList.DataSource = distributorGradeRequest.Data;
            this.rptList.DataBind();
            this.pager.TotalRecords = distributorGradeRequest.TotalRecords;
        }
コード例 #3
0
        private void BindData()
        {
            DistributorGradeQuery distributorGradeQuery = new DistributorGradeQuery();

            distributorGradeQuery.Name      = this.Name;
            distributorGradeQuery.SortBy    = "GradeID";
            distributorGradeQuery.SortOrder = SortAction.Asc;
            Globals.EntityCoding(distributorGradeQuery, true);
            distributorGradeQuery.PageIndex = 1;
            distributorGradeQuery.PageSize  = 100;
            DbQueryResult distributorGradeRequest = DistributorGradeBrower.GetDistributorGradeRequest(distributorGradeQuery);

            if (this.GradeCountDic == null)
            {
                this.GradeCountDic = DistributorGradeBrower.GetGradeCount("0");
            }
            this.rptList.DataSource = distributorGradeRequest.Data;
            this.rptList.DataBind();
        }
コード例 #4
0
 public static DbQueryResult GetDistributorGradeRequest(DistributorGradeQuery query)
 {
     return(new DistributorGradeDao().GetDistributorGradeRequest(query));
 }