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("保存失败"); } }
//读书笔记 public bool insertNote(ReadingNote plan) { if (plan.UserId == null || plan.ISBN == null || plan.UserId.Equals("") || plan.ISBN.Equals("")) { return(false); } if (dbConn.Insert(plan) > 0) { return(true); } return(false); }
//读书笔记 public bool insertNote(ReadingNote plan) { if (plan.UserId == null || plan.ISBN == null || plan.UserId.Equals("") || plan.ISBN.Equals("")) { return false; } if (dbConn.Insert(plan) > 0) { return true; } return false; }