public void AddNote() { Note note = new Note(); note.Title = txtTitle.Text; note.Content = txtContent.Text; note.UserID = _currentUser.UserID; bool result = _noteController.Add(note); try { if (result) { MessageBox.Show("Notunuz başarıyla kaydedildi."); txtContent.Clear(); txtTitle.Clear(); FillNote(); } else { MessageBox.Show("Notunuz kaydedilirken bir hata olustu"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { if (currentNote == null) { Note newNote = new Note(); newNote.UserID = currentUser.UserID; newNote.Title = txtTitle.Text; newNote.Content = txtContent.Text; _noteController.Add(newNote); } else { currentNote.Title = txtTitle.Text; currentNote.Content = txtContent.Text; _noteController.Update(currentNote); } this.Close(); }
private void AddNote() { Note note = new Note(); note.Title = txtTitle.Text; note.Content = txtContent.Text; note.UserID = _user.UserID; bool result = _noteController.Add(note); if (result) { MessageBox.Show("Notunuz başarıyla eklendi!"); txtTitle.Clear(); txtContent.Clear(); FillNotes(); } else { MessageBox.Show("Notunuz kayıt edilemedi."); } }
void AddNote() { Note note = new Note(); note.Title = txtBaslik.Text; note.Content = txtContent.Text; note.UserID = _currentUser.UserID; bool result = _noteController.Add(note); if (result) { MessageBox.Show("Not Eklenmiştir"); txtBaslik.Clear(); txtContent.Clear(); FillNotes(); } else { MessageBox.Show("Not Eklenemedi !!!"); } }
private void AddNote() { Note note = new Note(); note.Title = txtTitle.Text; note.Content = txtContent.Text; note.UserID = _user.UserID; bool result = _noteController.Add(note); if (result) { MessageBox.Show("Not eklenmiştir."); txtTitle.Clear(); txtContent.Clear(); FillNotes(); } else { MessageBox.Show("Not eklenemedi"); } }