コード例 #1
0
        public async void GetCassetes()
        {
            Model.RentalShopEntities rs = new Model.RentalShopEntities();

            foreach (var item in rs.Cassetes)
            {
                p.Dispatcher.Invoke(() =>
                {
                    if (token.IsCancellationRequested)
                    {
                        return;
                    }
                    else
                    {
                        Cassetes.Add(new CasseteShortInfo
                        {
                            Cover = API.Image.ByteArrayToImage(item.Cover),
                            Id    = item.Catalog_Id,
                            Name  = item.Title
                        });
                    }
                });
            }
            IsUpdateAllows = true;
        }
コード例 #2
0
        private async void FindCommandClick(object sender)
        {
            Cassetes.Clear();
            if (_inputtext != null && _inputtext != "")
            {
                FindHandler find = new FindHandler();
                switch (SelectedArg)
                {
                case "Название":
                    foreach (var item in find.FindTitle(FindHandler.FieldType.Title, _inputtext))
                    {
                        Cassetes.Add(new CasseteShortInfo
                        {
                            Cover = API.Image.ByteArrayToImage(item.Cover),
                            Id    = item.Catalog_Id,
                            Name  = item.Title
                        });
                    }
                    break;

                case "Режиссер":
                    foreach (var item in find.FindTitle(FindHandler.FieldType.Director, _inputtext))
                    {
                        Cassetes.Add(new CasseteShortInfo
                        {
                            Cover = API.Image.ByteArrayToImage(item.Cover),
                            Id    = item.Catalog_Id,
                            Name  = item.Title
                        });
                    }
                    break;

                case "Цена":
                    foreach (var item in find.FindTitle(FindHandler.FieldType.Price, _inputtext))
                    {
                        Cassetes.Add(new CasseteShortInfo
                        {
                            Cover = API.Image.ByteArrayToImage(item.Cover),
                            Id    = item.Catalog_Id,
                            Name  = item.Title
                        });
                    }
                    break;

                case "Отдел":
                    foreach (var item in find.FindTitle(FindHandler.FieldType.Departament, _inputtext))
                    {
                        Cassetes.Add(new CasseteShortInfo
                        {
                            Cover = API.Image.ByteArrayToImage(item.Cover),
                            Id    = item.Catalog_Id,
                            Name  = item.Title
                        });
                    }
                    break;
                }
            }
        }