private void appbar_Complete_Click(object sender, EventArgs e) { note.dueCompleted = 1; note.Save(); this.dueDateText.Text = "Completed"; completeButton.IsEnabled = false; }
private void checkCategory(string catname) { var checkcategories = (from k in SterlingService.Current.Database.Query <Category, int>() where k.LazyValue.Value.categoryName == catname select k.LazyValue.Value).FirstOrDefault(); if (checkcategories == null) { MessageBoxResult res = MessageBox.Show("Would You like to create category named \"" + catname + "\" ?", "Category not found", MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { killProgress(); newCategories = new Category(); newCategories.categoryName = catname; newCategories.Save(); // NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); checkCategory(catname); } else { killProgress(); } } else { Debug.WriteLine(checkcategories.Id); Debug.WriteLine("category found"); notes = new Notes(); notes.categoryID = checkcategories.Id; notes.noteName = notetitle; notes.noteText = notetext; notes.createDate = DateTime.Now; if (!duedate) { } else { notes.DueDate = noteduedate; notes.isDue = 1; } Debug.WriteLine("notes.DueDate:" + notes.DueDate); notes.Save(); killProgress(); NavigationService.Navigate(new Uri("/CategoryPage.xaml?catID=" + notes.categoryID, UriKind.Relative)); } }
private void checkCategory(string catname) { var checkcategories = (from k in SterlingService.Current.Database.Query<Category, int>() where k.LazyValue.Value.categoryName == catname select k.LazyValue.Value).FirstOrDefault(); if (checkcategories == null) { MessageBoxResult res = MessageBox.Show("Would You like to create category named \"" + catname + "\" ?", "Category not found", MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { killProgress(); newCategories = new Category(); newCategories.categoryName = catname; newCategories.Save(); // NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); checkCategory(catname); } else { killProgress(); } } else { Debug.WriteLine(checkcategories.Id); Debug.WriteLine("category found"); notes = new Notes(); notes.categoryID = checkcategories.Id; notes.noteName = notetitle; notes.noteText = notetext; notes.createDate = DateTime.Now; if (!duedate) { } else { notes.DueDate = noteduedate; notes.isDue = 1; } Debug.WriteLine("notes.DueDate:"+ notes.DueDate); notes.Save(); killProgress(); NavigationService.Navigate(new Uri("/CategoryPage.xaml?catID=" + notes.categoryID, UriKind.Relative)); } }