private async void LoadCats()
        {
            var datas = await ResJsonReader.GetAll <IEnumerable <GoodsCategory> >(this.GetType().GetTypeInfo().Assembly, "RRExpress.Seller.Cats.json");

            this.Datas = datas.BuildTree <GoodsCategory, GoodsCategoryTreeNode, int>(c => c.PID, c => c.ID, 0);
            this.NotifyOfPropertyChange(() => this.Datas);
        }
Exemplo n.º 2
0
        private async Task LoadCats()
        {
            this.IsBusy = true;
            if (this.Catalogs != null)
            {
                return;
            }

            var datas = await ResJsonReader.GetAll <IEnumerable <GoodsCategory> >(this.GetType().GetTypeInfo().Assembly, "RRExpress.Store.Cats.json");

            this.Catalogs = datas.BuildTree <GoodsCategory, GoodsCategoryTreeNode, int>
                                (c => c.PID, c => c.ID, 0)
                            .ToList();

            this.NotifyOfPropertyChange(() => this.Catalogs);
            this.IsBusy = false;
        }
Exemplo n.º 3
0
        private async void LoadCats()
        {
            var datas = await ResJsonReader.GetAll <IEnumerable <GoodsCategory> >(this.GetType().GetTypeInfo().Assembly, "RRExpress.Seller.Cats.json");

            var nodes = datas.BuildTree <GoodsCategory, GoodsCategoryTreeNode, int>(c => c.PID, c => c.ID, 0);
            var cats  = nodes.ToList();

            cats.Insert(0, new GoodsCategoryTreeNode()
            {
                ID   = -1,
                PID  = -1,
                Data = new Entity.GoodsCategory()
                {
                    Name = "不限"
                }
            });
            this.Categories = cats;
            this.NotifyOfPropertyChange(() => this.Categories);
        }