public QueryResult QueryPrePayLogPayment(PrePayQueryFilter query) { int totalCount; return(new QueryResult() { Data = ObjectFactory <IPrePayQueryDA> .Instance.QueryPrePayLogPayment(query, out totalCount), TotalCount = totalCount }); }
private static DataTable QueryPrePayLog(PrePayQueryFilter queryEntity, string sqlName, out int totalCount) { CustomDataCommand cmd = DataCommandManager.CreateCustomDataCommandFromConfig(sqlName); PagingInfoEntity pagingEntity = new PagingInfoEntity(); pagingEntity.SortField = queryEntity.PagingInfo.SortBy; pagingEntity.MaximumRows = queryEntity.PagingInfo.PageSize; pagingEntity.StartRowIndex = queryEntity.PagingInfo.PageIndex * queryEntity.PagingInfo.PageSize; using (DynamicQuerySqlBuilder sqlBuilder = new DynamicQuerySqlBuilder( cmd.CommandText, cmd, pagingEntity, "CustomerSysNo DESC")) { sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "CustomerSysNo", DbType.Int32, "@CustomerSysNo", QueryConditionOperatorType.Equal, queryEntity.CustomerSysNo); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "CreateTime", DbType.DateTime, "@CreateTimeFrom", QueryConditionOperatorType.MoreThanOrEqual, queryEntity.CreateDateFrom); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "CreateTime", DbType.DateTime, "@CreateTimeTo", QueryConditionOperatorType.LessThan, queryEntity.CreateDateTo); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "OrderSysNo", DbType.Int32, "@OrderSysNo", QueryConditionOperatorType.Equal, queryEntity.OrderSysNo); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "PrePayType", DbType.Int32, "@PrePayType", QueryConditionOperatorType.Equal, queryEntity.PrePayType); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Status", DbType.AnsiStringFixedLength, "@Status", QueryConditionOperatorType.Equal, queryEntity.Status); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "CompanyCode", DbType.AnsiString, "@CompanyCode", QueryConditionOperatorType.Equal, queryEntity.CompanyCode); cmd.CommandText = sqlBuilder.BuildQuerySql(); DataTable dt = cmd.ExecuteDataTable(); totalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount")); return(dt); } }
private void dataGridPaymentLog_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { filter = viewModel.ConvertVM <CustomerPrePayVM, PrePayQueryFilter>(); filter.PagingInfo = new PagingInfo() { PageSize = e.PageSize, PageIndex = e.PageIndex, SortBy = e.SortField }; facade.QueryPrePayLogPayment(filter, (obj, args) => { if (args.FaultsHandle()) { return; } dataGridPaymentLog.ItemsSource = args.Result.Rows; dataGridPaymentLog.TotalCount = args.Result.TotalCount; }); }
public CustomerPrePayQuery() { filter = new PrePayQueryFilter(); viewModel = new CustomerPrePayVM(); InitializeComponent(); }
public virtual DataTable QueryPrePayLogPayment(PrePayQueryFilter filter, out int totalCount) { return(QueryPrePayLog(filter, "QueryPrePayLogPayment", out totalCount)); }
public void QueryPrePayLogPayment(PrePayQueryFilter request, EventHandler <RestClientEventArgs <dynamic> > callback) { string relativeUrl = "/CustomerService/PrePay/QueryPrePayLogPayment"; restClient.QueryDynamicData(relativeUrl, request, callback); }