Exemplo n.º 1
0
        private void savenotebtn_Click(object sender, RoutedEventArgs e)
        {
            ReadingNote note = new ReadingNote();

            note.UserId      = phoneAppServeice.State["username"].ToString();
            note.ISBN        = ISBN;
            note.NoteContent = this.notecontent.Text + "\n";
            note.NoteTime    = DateTime.Now.ToString();

            Debug.WriteLine("[DEBUG]note.UserId: " + note.UserId + "  note.ISBN:" + note.ISBN + "  note.NoteContent" + note.NoteContent +
                            "  note.NoteTime:" + note.NoteTime);

            bool result = bookService.insertNote(note);

            if (result)
            {
                MessageBox.Show("保存成功");
                this.notecontent.Text = "";
                showNoteList();
            }
            else
            {
                MessageBox.Show("保存失败");
            }
        }