Ejemplo n.º 1
0
        void dgDeductInfo_LoadingDataSource(object sender, LoadingDataEventArgs e)
        {
            DeductQueryFilter filter = new DeductQueryFilter()
            {
                DeductType = DeductType.Temp, Status = Status.Effective
            };

            serviceFacade.QueryDeducts(filter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    ItemList = new List <DeductVM>();
                    return;
                }
                ItemList = DynamicConverter <DeductVM> .ConvertToVMList(args.Result.Rows);
                this.dgDeductInfo.ItemsSource = ItemList;
            });
        }
Ejemplo n.º 2
0
        private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            var queryRequest = EntityConverter <DeductQueryVM, DeductQueryFilter> .Convert(deductQueryVM);

            queryRequest.PageInfo = new PagingInfo()
            {
                PageSize  = QueryResultGrid.PageSize,
                PageIndex = QueryResultGrid.PageIndex,
                SortBy    = e.SortField
            };
            deductFacade.QueryDeducts(queryRequest, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                var deductList             = args.Result.Rows;
                int totalCount             = args.Result.TotalCount;
                QueryResultGrid.TotalCount = totalCount;

                //作废扣款项只能查看
                foreach (var item in deductList)
                {
                    bool edtiVisibility    = false;
                    bool abandonVisibility = true;
                    bool viewVisibility    = false;
                    if (item.Status == Status.Effective)
                    {
                        edtiVisibility    = true;
                        abandonVisibility = true;
                        viewVisibility    = false;
                    }
                    else
                    {
                        abandonVisibility = false;
                        viewVisibility    = true;
                    }
                    item.ViewButtonVisibility    = viewVisibility;
                    item.AbandonButtonVisibility = abandonVisibility;
                    item.EditButtonVisibility    = edtiVisibility;
                }
                QueryResultGrid.ItemsSource = deductList;
            });
        }