Ejemplo n.º 1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (NavigationContext.QueryString.TryGetValue("BookISBN", out ISBN))
            {
                dbPath = Path.Combine(Path.Combine(ApplicationData.Current.LocalFolder.Path, "jadeface.sqlite"));
                dbConn = new SQLiteConnection(dbPath);
                SQLiteCommand command = dbConn.CreateCommand("select * from booklistitem where isbn = '" + ISBN + "'");
                List<BookListItem> books = command.ExecuteQuery<BookListItem>();
                if (books.Count == 1)
                {
                    book = books.First();
                    //BookDetailGrid.DataContext = book;
                }

            }
            else
            {
                MessageBox.Show("详细信息页面加载出错!");
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
            }

            bookService = BookService.getInstance();
            showNoteList();
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            plan = GetSeletcedPlan();

            bookService = BookService.getInstance();

            List<string> pl = new List<string>() { "高", "中", "低" };
            this.prioritylist.ItemsSource = pl;

            this.prioritylist.SelectedItem = plan.Priority;

            this.bookname.Text = plan.Title;
            //this.bookname.IsEnabled = false;
            this.bookname.IsReadOnly = true;
            this.bookname.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));

            if (flag)
            {
                this.datePicker.Value = DateTime.Parse(plan.DatePicker);
                this.timepicker.Value = DateTime.Parse(plan.RingTime);
                flag = false;
            }

            this.detail.Text = plan.Detail;

            this.toggle.IsChecked = plan.IsReminder;

            isRemind = plan.IsReminder;
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     Debug.WriteLine("[DEBUG]Navigate to FinishBookListPage...");
     bookService = BookService.getInstance();
     RefreshFinishBookList();
     base.OnNavigatedTo(e);
 }
Ejemplo n.º 4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            bookService = BookService.getInstance();
            this.datePicker.ValueChanged += new EventHandler<DateTimeValueChangedEventArgs>(picker_ValueChanged);
            List<string> pl = new List<string>() { "高", "中", "低" };
            this.prioritylist.ItemsSource = pl;
            this.prioritylist.SelectedItem = pl[1];

            string username = phoneAppServeice.State["username"].ToString();
            dbPath = Path.Combine(Path.Combine(ApplicationData.Current.LocalFolder.Path, "jadeface.sqlite"));
            dbConn = new SQLiteConnection(dbPath);
            SQLiteCommand command = dbConn.CreateCommand("select * from booklistitem where userid = '" + username + "' and status = 1");
            List<BookListItem> books = command.ExecuteQuery<BookListItem>();

            Debug.WriteLine("[DEBUG]The count of book name list : " + books.Count);

            List<string> bookns = new List<string>();
            foreach (BookListItem book in books)
            {
                bookns.Add(book.Title);
            }
            bl = books;
            this.booknamelist.ItemsSource = bookns;
            base.OnNavigatedTo(e);
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string ISBN = "";

            if (NavigationContext.QueryString.TryGetValue("BookISBN", out ISBN))
            {
                currentISBN = ISBN;
                dbPath = Path.Combine(Path.Combine(ApplicationData.Current.LocalFolder.Path, "jadeface.sqlite"));
                dbConn = new SQLiteConnection(dbPath);
                SQLiteCommand command = dbConn.CreateCommand("select * from booklistitem where isbn = '" + ISBN + "'");
                List<BookListItem> books = command.ExecuteQuery<BookListItem>();
                if (books.Count == 1)
                {
                    book = books.First();
                    BookInformationGrid.DataContext = book;

                    StartPage.Text = "";
                    EndPage.Text = "";
                    ReadingRecordPanel.DataContext = record;
                }
                Debug.WriteLine("[DEBUG]Navigate to ReadingRecordPage...");
                bookService = BookService.getInstance();
                RefreshReadingRecord();
            }
            else
            {
                MessageBox.Show("读书记录页面加载出错!");
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
            }
        }
Ejemplo n.º 6
0
 public static BookService getInstance()
 {
     if (service == null)
     {
         service = new BookService();
         return service;
     }
     else
     {
         return service;
     }
 }
Ejemplo n.º 7
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Debug.WriteLine("[DEBUG]Navigate to MainPage...");
            bookService = BookService.getInstance();
            RefreshBookList();
            //RefreshWishBookList();

            //新增
            RefreshReadingPlanItems();

            //RefreshFinishBookList();
            base.OnNavigatedTo(e);
        }