示例#1
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(ProductConsultationAndReplyQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(query);
                dataGridViewModel.rows  = DataHelper.DataTableToDictionary(consultationProducts.Data);
                dataGridViewModel.total = consultationProducts.TotalRecords;
                foreach (Dictionary <string, object> row in dataGridViewModel.rows)
                {
                    row.Add("Type", (int)query.Type);
                }
            }
            return(dataGridViewModel);
        }
        private void BinddlstProductConsultation()
        {
            ProductConsultationAndReplyQuery productConsultationAndReplyQuery = new ProductConsultationAndReplyQuery();

            productConsultationAndReplyQuery.Keywords    = this.keywords;
            productConsultationAndReplyQuery.CategoryId  = this.categoryId;
            productConsultationAndReplyQuery.ProductCode = this.productCode;
            productConsultationAndReplyQuery.PageIndex   = this.pager.PageIndex;
            productConsultationAndReplyQuery.PageSize    = this.pager.PageSize;
            productConsultationAndReplyQuery.SortOrder   = SortAction.Desc;
            productConsultationAndReplyQuery.SortBy      = "ReplyDate";
            productConsultationAndReplyQuery.Type        = ConsultationReplyType.Replyed;
            Globals.EntityCoding(productConsultationAndReplyQuery, true);
            DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(productConsultationAndReplyQuery);

            this.grdConsultation.DataSource = consultationProducts.Data;
            this.grdConsultation.DataBind();
            this.pager.TotalRecords = consultationProducts.TotalRecords;
        }
        private void BindConsultation()
        {
            ProductConsultationAndReplyQuery entity = new ProductConsultationAndReplyQuery();

            entity.Keywords    = keywords;
            entity.CategoryId  = categoryId;
            entity.ProductCode = productCode;
            entity.PageIndex   = pager.PageIndex;
            entity.PageSize    = pager.PageSize;
            entity.SortOrder   = SortAction.Desc;
            entity.SortBy      = "ReplyDate";
            entity.Type        = ConsultationReplyType.NoReply;
            Globals.EntityCoding(entity, true);
            DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(entity);

            grdConsultation.DataSource = consultationProducts.Data;
            grdConsultation.DataBind();
            pager.TotalRecords  = consultationProducts.TotalRecords;
            pager1.TotalRecords = consultationProducts.TotalRecords;
        }
        private void BinddlstProductConsultation()
        {
            ProductConsultationAndReplyQuery entity = new ProductConsultationAndReplyQuery {
                Keywords    = this.keywords,
                CategoryId  = this.categoryId,
                ProductCode = this.productCode,
                PageIndex   = this.pager.PageIndex,
                PageSize    = this.pager.PageSize,
                SortOrder   = SortAction.Desc,
                SortBy      = "ReplyDate",
                Type        = ConsultationReplyType.Replyed
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(entity);

            this.grdConsultation.DataSource = consultationProducts.Data;
            this.grdConsultation.DataBind();
            this.pager.TotalRecords = consultationProducts.TotalRecords;
        }