Пример #1
0
        /// <summary>
        /// SAP确认人查询
        /// </summary>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public virtual DataTable QueryIPPUser(SAPIPPUserQueryFilter query, out int totalCount)
        {
            PagingInfoEntity pagingEntity = new PagingInfoEntity();

            pagingEntity.SortField     = query.PagingInfo.SortBy;
            pagingEntity.MaximumRows   = query.PagingInfo.PageSize;
            pagingEntity.StartRowIndex = query.PagingInfo.PageIndex * query.PagingInfo.PageSize;

            CustomDataCommand dataCommand = DataCommandManager.CreateCustomDataCommandFromConfig("QuerySAPIPPUser");

            using (DynamicQuerySqlBuilder sqlBuilder = new DynamicQuerySqlBuilder(
                       dataCommand.CommandText, dataCommand, pagingEntity, "I.SysNo desc"))
            {
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "I.PayType",
                                                             DbType.Int32, "@PayType", QueryConditionOperatorType.Equal, query.PayType);

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "I.CustID",
                                                             DbType.String, "@CustID", QueryConditionOperatorType.Equal, query.CustID);

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "I.SystemConfirmID",
                                                             DbType.String, "@SystemConfirmID", QueryConditionOperatorType.Equal, query.SystemConfirmID);

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "I.CompanyCode",
                                                             DbType.String, "@CompanyCode", QueryConditionOperatorType.Equal, query.CompanyCode);

                dataCommand.CommandText = sqlBuilder.BuildQuerySql();
                EnumColumnList enumColumnList = new EnumColumnList();
                enumColumnList.Add("Status", typeof(SAPStatus));
                DataTable dt = dataCommand.ExecuteDataTable(enumColumnList);
                totalCount = Convert.ToInt32(dataCommand.GetParameterValue("@TotalCount"));
                return(dt);
            }
        }
Пример #2
0
        public void QueryIPPUser(SAPIPPUserQueryVM queryVM, int pageSize, int pageIndex, string sortField, Action <dynamic> callback)
        {
            SAPIPPUserQueryFilter filter = queryVM.ConvertVM <SAPIPPUserQueryVM, SAPIPPUserQueryFilter>();

            filter.PagingInfo = new PagingInfo()
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                SortBy    = sortField
            };
            filter.CompanyCode = CPApplication.Current.CompanyCode;
            string relativeUrl = "/InvoiceService/SAP/QueryIPPUser";

            restClient.QueryDynamicData(relativeUrl, filter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                callback(args.Result);
            });
        }