Ejemplo n.º 1
0
        public static List<Area> GetAllAreas()
        {
            AreaCollection list = new AreaCollection();
            list.OrderByAsc(Area.Columns.Description);
            list.Load();

            return list.ToList();
        }
        public MainWindowViewModel()
        {
            var reader = new HttpDataReader();

            var areas = new AreaCollection(reader);

            Task.Run(async() => await areas.Load())
            .ContinueWith(_ => this.Areas = areas.List);

            var prefs = new Prefs(reader);

            Task.Run(async() => await prefs.Load())
            .ContinueWith(_ => this.Prefs = prefs.List);

            var areaL = new AreaLs(reader);

            Task.Run(async() => await areaL.Load())
            .ContinueWith(_ => this.AreaLs = areaL.List);

            var areaM = new AreaMs(reader);

            Task.Run(async() => await areaM.Load())
            .ContinueWith(_ => this.AreaMs = areaM.List);

            var areaS = new AreaSs(reader);

            Task.Run(async() => await areaS.Load())
            .ContinueWith(_ => this.AreaSs = areaS.List);

            var categoryL = new CategoryLs(reader);

            Task.Run(async() => await categoryL.Load())
            .ContinueWith(_ => this.CategoryLs = categoryL.List);

            var categoryS = new CategorySs(reader);

            Task.Run(async() => await categoryS.Load())
            .ContinueWith(_ => this.CategorySs = categoryS.List);

            this.SearchCommand = new DelegateCommand(this.OnSearch);
            this.SearchConditionClearCommand = new DelegateCommand(this.OnSearchConditionClear);
            this.PagePreviewCommand          = new DelegateCommand(this.OnPagePreview, this.CanPrevPage);
            this.PageNextCommand             = new DelegateCommand(this.OnPageNext, this.CanNextPage);
        }