예제 #1
0
        public QueryResult GetCHSet(CHQueryFilter query)
        {
            int totalCount;

            return(new QueryResult()
            {
                Data = ObjectFactory <IFPCheckQueryDA> .Instance.QueryCHSet(query, out totalCount),
                TotalCount = totalCount
            });
        }
예제 #2
0
 public override void OnPageLoad(object sender, EventArgs e)
 {
     fpCheckFacade       = new FPCheckFacade(this);
     queryRequest        = new CHQueryFilter();
     viewModel.ChannelID = this.Request.Param;
     base.OnPageLoad(sender, e);
     if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Customer_CHSet_Add))
     {
         this.Button_New.IsEnabled = false;
     }
 }
예제 #3
0
        public virtual DataTable QueryCHSet(CHQueryFilter queryCriteria, out int totalCount)
        {
            PagingInfoEntity pagingEntity = new PagingInfoEntity();

            pagingEntity.SortField     = queryCriteria.PagingInfo.SortBy;
            pagingEntity.MaximumRows   = queryCriteria.PagingInfo.PageSize;
            pagingEntity.StartRowIndex = queryCriteria.PagingInfo.PageIndex * queryCriteria.PagingInfo.PageSize;
            var cmd = DataCommandManager.CreateCustomDataCommandFromConfig("QueryCHSet");

            using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, pagingEntity, " a.sysno desc "))
            {
                if (!string.IsNullOrEmpty(queryCriteria.ProductID) || !queryCriteria.IsSearchCategory)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.ReferenceType", DbType.AnsiStringFixedLength, "@ReferenceType",
                        QueryConditionOperatorType.Equal, ("PID"));
                }
                else if (queryCriteria.CategorySysNo != null || queryCriteria.IsSearchCategory)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(
                        QueryConditionRelationType.AND,
                        "a.ReferenceType", DbType.AnsiStringFixedLength, "@ReferenceType",
                        QueryConditionOperatorType.Equal, ("PC3"));
                }
                sqlBuilder.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "a.ReferenceContent", DbType.AnsiStringFixedLength, "@ProductID",
                    QueryConditionOperatorType.Equal, queryCriteria.ProductID);

                sqlBuilder.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "a.Description", DbType.AnsiStringFixedLength, "@CategorySysNo",
                    QueryConditionOperatorType.Equal, queryCriteria.CategorySysNo);

                sqlBuilder.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "a.Status", DbType.AnsiStringFixedLength, "@Status",
                    QueryConditionOperatorType.Equal, queryCriteria.Status);

                cmd.CommandText = sqlBuilder.BuildQuerySql();
                EnumColumnList cl = new EnumColumnList();
                cl.Add(5, typeof(FPCheckItemStatus));
                cl.Add(6, typeof(FPCheckItemStatus));
                DataTable dt = cmd.ExecuteDataTable(cl);
                totalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount"));
                return(dt);
            }
        }
예제 #4
0
        private void DataGrid_ResultList_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            queryRequest                      = viewModel.ConvertVM <CHSetVM, CHQueryFilter>();
            queryRequest.PagingInfo           = new QueryFilter.Common.PagingInfo();
            queryRequest.PagingInfo.PageSize  = e.PageSize;
            queryRequest.PagingInfo.PageIndex = e.PageIndex;
            queryRequest.PagingInfo.SortBy    = e.SortField;
            fpCheckFacade.Query(queryRequest, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                DataGrid_ResultList.ItemsSource = args.Result.Rows;
                DataGrid_ResultList.TotalCount  = args.Result.TotalCount;
            });
        }
예제 #5
0
        /// <summary>
        /// 查询串货订单设置限制
        /// </summary>
        /// <param name="vm"></param>
        /// <param name="callback"></param>
        public void Query(CHQueryFilter filter, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "/CustomerService/CHSet/Query";

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