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); 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) { Debug.WriteLine("[DEBUG]Navigate to WishBookListPage..."); bookService = BookService.getInstance(); RefreshWishBookList(); base.OnNavigatedTo(e); }
public void RefreshFinishBookListFuncTest() //刷新完成书单功能测试 { BookService service = BookService.getInstance(); List <BookListItem> list = service.RefreshFinishBookList("TestUser"); Assert.IsTrue(list != null); }
public void RefreshFinishBookListBoundaryTest() //刷新完成书单边界测试 { BookService service = BookService.getInstance(); List <BookListItem> list = service.RefreshFinishBookList(""); Assert.IsTrue(list == null); }
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)); } }
public void BookServiceUpdateBoundaryTest() //BookService边界测试 { BookService service = BookService.getInstance(); BookListItem book = new BookListItem(); //边界测试需要的数据 bool ret3 = service.update(book); //边界测试4,更新,Book内容为空 Assert.IsTrue(ret3 == false); }
public void BookServiceInsertBoundaryTest() //BookService边界测试 { BookService service = BookService.getInstance(); BookListItem book = new BookListItem(); //边界测试需要的数据 bool ret = service.insert(book); //边界测试1,插入,Book内容为空 Assert.IsTrue(ret == false); }
public void BookServiceDeleteBoundaryTest() //BookService边界测试 { BookService service = BookService.getInstance(); BookListItem book = new BookListItem(); //边界测试需要的数据 bool ret2 = service.delete(book, ""); //边界测试3,删除,username为空 Assert.IsTrue(ret2 == false); }
public void BookServiceSearchBoundaryTest() //BookService边界测试 { BookService service = BookService.getInstance(); BookListItem book = new BookListItem(); //边界测试需要的数据 List <BookListItem> list; list = service.searchByISBN(book.ISBN, ""); Assert.IsTrue(list == null); //边界测试2,查询,username为空 }
protected override void OnNavigatedTo(NavigationEventArgs e) { Debug.WriteLine("[DEBUG]Navigate to MainPage..."); bookService = BookService.getInstance(); RefreshBookList(); //RefreshWishBookList(); //新增 RefreshReadingPlanItems(); //RefreshFinishBookList(); base.OnNavigatedTo(e); }
public void BookServiceUpdateFuncTest() //BookService功能测试 { BookService service = BookService.getInstance(); List <BookListItem> list; list = service.searchByISBN("10010", "TestUser"); //正常测试需要的数据 BookListItem book2 = list[0]; book2.Author = "TestAuthorx"; bool ret5 = service.update(book2); //正常测试3,更新 Assert.IsTrue(ret5 == true); }
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; }