Esempio n. 1
0
        //查询
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            //构造查询条件
            this.queryFilter = EntityConverter <ConsignAdjustQueryVM, ConsignAdjustQueryFilter> .Convert(queryVM);

            QueryResultGrid.Bind();
        }
Esempio n. 2
0
        public DataTable Query(ConsignAdjustQueryFilter queryFilter, out int totalCount)
        {
            if (queryFilter == null)
            {
                totalCount = -1;
                return(null);
            }

            CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("QueryConsignAdjustList");

            PagingInfoEntity pagingInfo = new PagingInfoEntity()
            {
                SortField     = queryFilter.PageInfo.SortBy,
                StartRowIndex = queryFilter.PageInfo.PageIndex * queryFilter.PageInfo.PageSize,
                MaximumRows   = queryFilter.PageInfo.PageSize
            };

            using (DynamicQuerySqlBuilder sqlBuilder = new DynamicQuerySqlBuilder(command.CommandText, command, pagingInfo, "C.SysNo DESC"))
            {
                if (queryFilter.VendorSysNo.HasValue)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "C.VendorSysNo",
                                                                 DbType.Int32, "@VendorSysNo", QueryConditionOperatorType.Equal, queryFilter.VendorSysNo.Value);
                }

                if (queryFilter.PMSysNo.HasValue)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "C.PMSysNo",
                                                                 DbType.Int32, "@PMSysNo", QueryConditionOperatorType.Equal, queryFilter.PMSysNo.Value);
                }

                if (queryFilter.Status.HasValue)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "C.Status",
                                                                 DbType.Int32, "@Status", QueryConditionOperatorType.Equal, queryFilter.Status.Value);
                }
                //if (queryFilter.SettleSysno.HasValue)
                //{
                //    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "SettleSysno",
                //   DbType.Int32, "@SettleSysno", QueryConditionOperatorType.Equal, queryFilter.SettleSysno.Value);
                //}

                if (queryFilter.SettleRange.HasValue)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "C.SettleRange",
                                                                 DbType.String, "@SettleRange", QueryConditionOperatorType.Equal, queryFilter.SettleRange.Value.ToString("yyyy-MM"));
                }

                command.CommandText = sqlBuilder.BuildQuerySql();
                command.SetParameterValue("@StartNumber", queryFilter.PageInfo.PageSize * queryFilter.PageInfo.PageIndex);
                command.SetParameterValue("@EndNumber", queryFilter.PageInfo.PageSize * queryFilter.PageInfo.PageIndex + queryFilter.PageInfo.PageSize);
                EnumColumnList columnEnums = new EnumColumnList();
                columnEnums.Add("Status", typeof(ConsignAdjustStatus));
                DataTable dt = command.ExecuteDataTable(columnEnums);
                totalCount = Convert.ToInt32(command.GetParameterValue("@TotalCount"));
                return(dt);
            }
        }
Esempio n. 3
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            queryVM       = new ConsignAdjustQueryVM();
            queryFilter   = new ConsignAdjustQueryFilter();
            serviceFacade = new ConsignAdjustFacade(this);
            InitControlData();

            this.DataContext = queryVM;
            base.OnPageLoad(sender, e);
        }
Esempio n. 4
0
        public QueryResult QueryConsignAdjustList(ConsignAdjustQueryFilter request)
        {
            int         totalCount   = 0;
            QueryResult returnResult = new QueryResult()
            {
                Data = ObjectFactory <IConsignAdjustDA> .Instance.Query(request, out totalCount)
            };

            returnResult.TotalCount = totalCount;
            return(returnResult);
        }
Esempio n. 5
0
        /// <summary>
        /// 查询扣款项维护列表
        /// </summary>
        /// <param name="request"></param>
        /// <param name="callback"></param>
        public void Query(ConsignAdjustQueryFilter request, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "/POService/ConsignAdjust/QueryConsignAdjustList";

            restClient.QueryDynamicData(relativeUrl, request, callback);
        }