private void btnChooseManufacturer_Click(object sender, RoutedEventArgs e) { UCManufacturerQuery selectDialog = new UCManufacturerQuery(); selectDialog.Dialog = CPApplication.Current.CurrentPage.Context.Window.ShowDialog("查询代理厂商", selectDialog, (obj, args) => { if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK) { DynamicXml getSelectedManufacturer = args.Data as DynamicXml; if (null != getSelectedManufacturer) { this.SelectedManufacturerSysNo = getSelectedManufacturer["SysNo"].ToString(); this.SelectedManufacturerName = getSelectedManufacturer["ManufacturerNameLocal"].ToString(); BrandQueryFilter requestBrand = new BrandQueryFilter() { ManufacturerSysNo = int.Parse(SelectedManufacturerSysNo), ManufacturerName = SelectedManufacturerName, PagingInfo = new QueryFilter.Common.PagingInfo() { PageIndex = 0, PageSize = 1 } }; serviceFacade.QueryBrands(requestBrand, (obj2, args2) => { if (args2.FaultsHandle()) { return; } var brandList = args2.Result.Rows; if (null != brandList) { try { SelectedBrandSysNo = null != brandList[0]["SysNo"] ? brandList[0]["SysNo"].ToString() : string.Empty; SelectedBrandName = brandList[0]["BrandName_Ch"]; } catch { SelectedBrandSysNo = null; SelectedBrandName = null; } } }); } } }, new Size(750, 500)); }
private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { queryFilter.PagingInfo = new ECCentral.QueryFilter.Common.PagingInfo() { PageSize = QueryResultGrid.PageSize, PageIndex = QueryResultGrid.PageIndex, SortBy = e.SortField }; queryFilter.PagingInfo.SortBy = e.SortField; serviceFacade.QueryBrands(queryFilter, (obj, args) => { if (args.FaultsHandle()) { return; } var vendorList = args.Result.Rows; int totalCount = args.Result.TotalCount; QueryResultGrid.TotalCount = totalCount; QueryResultGrid.ItemsSource = vendorList; }); }