/// <summary> /// Handles the Click event of the SaveNoteButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private async void SaveNoteButton_Click(object sender, RoutedEventArgs e) { NOTE note = new NOTE(); note.TITLE = this.noteTitle.Text; note.CONTENT = this.noteContent.Text; note.LESSON_ID = allLessons[selectLessonComboBox.SelectedIndex].ID; note.CUSTOMER_ID = Constants.User.ID; note.DATE = DateTime.Now; note.SHARE = sharableCheckBox.IsChecked ?? false; if (note == null) { System.Diagnostics.Debug.WriteLine("note is null!"); } ctx.AddToNOTE(note); ctx.BeginSaveChanges(onNoteSaved, null); this.addNotePopup.IsOpen = false; ClearNote(); MessageDialog md = new MessageDialog("Note Saved", "Your note have been saved!"); await md.ShowAsync(); //md.Content = "Your note have been saved!"; }
/// <summary> /// Inserts the note. /// </summary> /// <param name="note">The note.</param> /// <param name="onComplete">The on complete.</param> public void InsertNote(NOTE note, OnQueryComplete onComplete) { ctx.AddToNOTE(note); this.onUQC = onComplete; ctx.BeginSaveChanges(onQueryComplete2, null); }