Exemplo n.º 1
0
        private 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
            };

            p.SortBy = string.IsNullOrEmpty(p.SortBy) ? " B.SysNo desc " : p.SortBy;
            HelpCenterFacade facade = new HelpCenterFacade(this);

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

                this.DataGrid.TotalCount = args.Result.TotalCount;
                var rows = args.Result.Rows;

                this.DataGrid.ItemsSource = rows;
            });
        }
Exemplo n.º 2
0
        void lstChannel_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.lstChannel.SelectedValue == null)
            {
                return;
            }
            //如果已经加载了对应渠道的帮助分类列表,直接返回
            if (this.lstHelpCategory.Tag == this.lstChannel.SelectedValue)
            {
                return;
            }
            HelpCenterFacade helpCenterFacade = new HelpCenterFacade(this);

            helpCenterFacade.QueryCategory(CPApplication.Current.CompanyCode, this.lstChannel.SelectedValue.ToString(), (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                List <HelpCenterCategoryVM> helpCategoryList = DynamicConverter <HelpCenterCategoryVM> .ConvertToVMList(args.Result.Rows);
                if (helpCategoryList != null)
                {
                    helpCategoryList.Insert(0, new HelpCenterCategoryVM {
                        SysNo = null, Name = ResCommonEnum.Enum_Select
                    });
                }
                this.lstHelpCategory.ItemsSource = helpCategoryList;
                this.lstHelpCategory.Tag         = this.lstChannel.SelectedValue;
            });
        }
Exemplo n.º 3
0
 private void lstChannel_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.lstChannel.SelectedValue != null)
     {
         //根据渠道的变化,动态加载帮助类型
         HelpCenterFacade helpCenterFacade = new HelpCenterFacade(this);
         helpCenterFacade.QueryCategory(CPApplication.Current.CompanyCode, this.lstChannel.SelectedValue.ToString(), (s, args) =>
         {
             if (args.FaultsHandle())
             {
                 return;
             }
             List <HelpCenterCategoryVM> helpCategoryList = DynamicConverter <HelpCenterCategoryVM> .ConvertToVMList(args.Result.Rows);
             BindHelpTypeList(helpCategoryList);
         });
     }
     else
     {
         BindHelpTypeList(null);
     }
 }