Beispiel #1
0
        private void StoreListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            StoreListing sent = e.ClickedItem as StoreListing;

            //sent.Price = 50.ToString();
            Frame.Navigate(typeof(StoreDetail), sent);
        }
Beispiel #2
0
        private void StoreListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            StoreListing  sent = e.ClickedItem as StoreListing;
            PurchasedView p    = new PurchasedView();

            p.purchases = test;
            p.sel       = sent;
            //sent.Price = 50.ToString();
            Frame.Navigate(typeof(CreateDetail), p);
        }
Beispiel #3
0
        private async void CreateCollection_Loaded(object sender, RoutedEventArgs e)
        {
            LoadingBar.Visibility      = Visibility.Visible;
            LoadingBar.IsIndeterminate = true;
            try
            {
                StorageFolder folder     = Windows.Storage.ApplicationData.Current.LocalFolder;
                StorageFile   sampleFile = await folder.GetFileAsync("sample.txt");

                testlol = await Windows.Storage.FileIO.ReadTextAsync(sampleFile);

                items = await Table.Where(User
                                          => User.username == testlol).ToCollectionAsync();

                test = items[0].purchases;
                string[] test2 = test.Split(',');
                if (test.Length == 0)
                {
                    noPurchase.Text       = "You have not purchased anything";
                    noPurchase.Visibility = Visibility.Visible;
                    LoadingBar.Visibility = Visibility.Collapsed;
                    goto ex;
                }
                for (int i = 0; i < test2.Length; i++)
                {
                    string   test3 = test2[i];
                    string[] test4 = test3.Split('.');
                    lis.Add(test4[0]);
                }
                items2 = await Table2.Where(Book
                                            => lis.Contains(Book.Id)).ToCollectionAsync();

                StoreListing temp;
                StoreList = new List <StoreListing>();
                foreach (Book lol in items2)
                {
                    temp        = new StoreListing();
                    temp.Title  = lol.Title;
                    temp.Author = lol.Author;
                    temp.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(lol.ImageUri2));
                    temp.Id     = lol.Id;
                    temp.Price  = lol.Price.ToString();
                    StoreList.Add(temp);
                }
                LoadingBar.Visibility = Visibility.Collapsed;

                StoreListView.ItemsSource = StoreList;
                ex :;
            }
            catch (Exception)
            {
                LoadingBar.Visibility = Visibility.Collapsed;
                await(new MessageDialog("Can't Update Now")).ShowAsync();
            }
        }
Beispiel #4
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            LoadingBar.IsIndeterminate = true;
            LoadingBar.Visibility      = Visibility.Visible;
            rec            = new StoreListing();
            rec            = e.Parameter as StoreListing;
            Title.Text     = rec.Title;
            Cover.Source   = rec.Image;
            FullCost.Text  = rec.Price;
            Author.Text    = rec.Author;
            DescBlock.Text = rec.desc;
            FullCost.Text  = "Full Book Price: " + rec.Price;

            try
            {
                StorageFolder folder     = Windows.Storage.ApplicationData.Current.LocalFolder;
                StorageFile   sampleFile = await folder.GetFileAsync("sample.txt");

                testlol = await Windows.Storage.FileIO.ReadTextAsync(sampleFile);

                list = new List <ChapterView>();
                ChapterView temp;
                try
                {
                    items = await Table.Where(Chapter
                                              => Chapter.bookid == rec.Id).ToCollectionAsync();

                    foreach (Chapter lol in items)
                    {
                        temp       = new ChapterView();
                        temp.Id    = lol.Id;
                        temp.Title = "Chapter: " + (lol.sno + 1).ToString();
                        temp.Price = "Price: " + lol.price.ToString();
                        list.Add(temp);
                    }
                    LoadingBar.Visibility     = Visibility.Collapsed;
                    StoreListView.ItemsSource = list;
                }
                catch (Exception)
                {
                    LoadingBar.Visibility = Visibility.Collapsed;
                    MessageDialog mess = new Windows.UI.Popups.MessageDialog("Sorry Can't load the chapters now :(:(");
                    await mess.ShowAsync();
                }
            }
            catch (Exception)
            {
                MessageDialog msgbox = new MessageDialog("Something is not right try later");
                await msgbox.ShowAsync();

                LoadingBar.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #5
0
        private async void Store_Loaded(object sender, RoutedEventArgs e)
        {
            Box.Visibility           = Visibility.Collapsed;
            SearchButton.Visibility  = Visibility.Collapsed;
            StoreListView.Visibility = Visibility.Collapsed;
            BookNames = new List <string>();
            StoreList = new List <StoreListing>();
            LoadingBar.IsIndeterminate = true;
            StoreListing temp;

            try
            {
                items = await Table.Where(Book
                                          => Book.IsReady == true).ToCollectionAsync();

                foreach (Book lol in items)
                {
                    temp = new StoreListing();
                    BookNames.Add(lol.Title);
                    temp.Title  = lol.Title;
                    temp.Author = lol.Author;
                    temp.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(lol.ImageUri2));
                    temp.Id     = lol.Id;
                    temp.Price  = lol.Price.ToString();
                    StoreList.Add(temp);
                }
                Box.AutoCompleteSource    = BookNames;
                StoreListView.ItemsSource = StoreList;
                Box.Visibility            = Visibility.Visible;
                StoreListView.Visibility  = Visibility.Visible;
                SearchButton.Visibility   = Visibility.Visible;
                LoadingBar.Visibility     = Visibility.Collapsed;
            }
            catch (Exception)
            {
                MessageDialog msgbox = new MessageDialog("Something is not right can't go forward now");
                await msgbox.ShowAsync();

                LoadingBar.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #6
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            StoreListView.Visibility = Visibility.Collapsed;
            SearchButton.Visibility  = Visibility.Collapsed;
            LoadingBar.Visibility    = Visibility.Visible;
            StoreList = new List <StoreListing>();
            LoadingBar.IsIndeterminate = true;
            StoreListing temp;

            try
            {
                items = await Table.Where(Book
                                          => Book.Title.Contains(Box.Text)).ToCollectionAsync();

                foreach (Book lol in items)
                {
                    temp        = new StoreListing();
                    temp.Id     = lol.Id;
                    temp.Title  = lol.Title;
                    temp.Author = lol.Author;
                    temp.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(lol.ImageUri2));
                    temp.Price  = lol.Price.ToString();
                    StoreList.Add(temp);
                }

                StoreListView.ItemsSource = StoreList;
                Box.Visibility            = Visibility.Visible;
                StoreListView.Visibility  = Visibility.Visible;
                SearchButton.Visibility   = Visibility.Visible;
                LoadingBar.Visibility     = Visibility.Collapsed;
            }
            catch (Exception)
            {
                MessageDialog msgbox = new MessageDialog("Something is not right at this time");
                await msgbox.ShowAsync();

                LoadingBar.Visibility = Visibility.Collapsed;
            }
        }