예제 #1
0
        /// <summary>
        /// 请求服务,并将查询结果绑定到DataGrid
        /// </summary>
        void DataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            //1.初始化查询条件,分页信息
            //2.请求服务查询
            m_queryReq.PagingInfo = new PagingInfo
            {
                PageIndex = e.PageIndex,
                PageSize  = e.PageSize,
                SortBy    = e.SortField
            };
            //不读取作废商品
            m_queryReq.IsNotAbandon = true;
            //不加载商家商品
            m_queryReq.AZCustomer    = 0;
            m_queryReq.MerchantSysNo = 1;

            m_facade.QueryProduct(m_queryReq, (s, args) =>
            {
                if (!args.FaultsHandle())
                {
                    DataGrid.TotalCount = args.Result.TotalCount;
                    Dictionary <string, object> changeColumns = new Dictionary <string, object>();
                    changeColumns.Add("IsCheck", false);
                    changeColumns.Add("Quantity", 1);
                    DataGrid.ItemsSource = args.Result.Rows.ToList(changeColumns);
                }
            });
        }
예제 #2
0
        /// <summary>
        /// 请求服务,并将查询结果绑定到DataGrid
        /// </summary>
        void DataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            //1.初始化查询条件,分页信息
            //2.请求服务查询
            PagingInfo p = new PagingInfo
            {
                PageIndex = e.PageIndex,
                PageSize  = e.PageSize,
                SortBy    = e.SortField
            };

            _viewModel.C3SysNo = ProductC3SysNo;
            ProductQueryFacade facade = new ProductQueryFacade(CPApplication.Current.CurrentPage);

            facade.QueryProduct(_viewModel, p, (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                BindDataGrid(args.Result.TotalCount, args.Result.Rows);
            });
        }