private void DataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            if (_queryVM.MinPriceRange != null && _queryVM.MaxPriceRange != null &&
                _queryVM.MinPriceRange >= _queryVM.MaxPriceRange)
            {
                this.Window.Alert("配置单金额最小值必须小于最大值!");
                return;
            }

            //1.初始化查询条件
            //2.请求服务查询
            PagingInfo p = new PagingInfo
            {
                PageIndex = e.PageIndex,
                PageSize  = e.PageSize,
                SortBy    = e.SortField
            };
            ComputerConfigFacade facade = new ComputerConfigFacade(this);

            facade.Query(_queryVM, p, (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                var rows = args.Result.Rows.ToList("IsChecked", false);
                this.DataGrid.ItemsSource = rows;
                this.DataGrid.TotalCount  = args.Result.TotalCount;
            });
        }
 private void lstChannelList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.lstChannelList.SelectedValue != null)
     {
         ComputerConfigFacade service = new ComputerConfigFacade(this);
         service.GetEditUsers(CPApplication.Current.CompanyCode, this.lstChannelList.SelectedValue.ToString(), (s, args) =>
         {
             if (args.FaultsHandle())
             {
                 return;
             }
             BindEditUsers(args.Result);
         });
     }
     else
     {
         BindEditUsers(null);
     }
 }
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);
            //绑定查询区域中的渠道列表
            var channelList = CPApplication.Current.CurrentWebChannelList.ToList <UIWebChannel>();

            channelList.Insert(0, new UIWebChannel {
                ChannelName = ResCommonEnum.Enum_All
            });
            this.lstChannelList.ItemsSource = channelList;

            _queryVM = new ComputerConfigMasterQueryVM();
            this.GridFilter.DataContext = _queryVM;

            this.lstOwner.ItemsSource   = EnumConverter.GetKeyValuePairs <ComputerConfigOwner>(EnumConverter.EnumAppendItemType.All);
            this.lstStatus.ItemsSource  = EnumConverter.GetKeyValuePairs <ComputerConfigStatus>(EnumConverter.EnumAppendItemType.All);
            this.lstOwner.SelectedIndex = 1;

            ComputerConfigFacade service = new ComputerConfigFacade(this);

            service.GetAllConfigTypes((s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                BindConfigTypes(args.Result);
            });

            service.GetEditUsers(CPApplication.Current.CompanyCode, "1", (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                BindEditUsers(args.Result);
            });
        }
Exemple #4
0
        void lstChannel_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.lstChannel.SelectedValue == null)
            {
                return;
            }
            //如果已经加载了,直接返回
            if (this.lstConfigTypes.Tag == this.lstChannel.SelectedValue)
            {
                return;
            }
            ComputerConfigFacade service = new ComputerConfigFacade(this);

            service.GetAllConfigTypes((s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                var configTypeList = args.Result;
                this.lstConfigTypes.ItemsSource = configTypeList;
                this.lstConfigTypes.Tag         = this.lstChannel.SelectedValue;
            });
        }