public void UpdateNote() { int noteID = (int)lstNotes.SelectedValue; Note updateNote = _noteController.GetByID(noteID); updateNote.Title = txtTitle.Text; updateNote.Content = txtContent.Text; bool result = _noteController.Update(updateNote); try { if (result) { MessageBox.Show("Notunuz Güncellendi"); txtContent.Clear(); txtTitle.Clear(); FillNote(); } else { MessageBox.Show("Notunuz güncellenirken bir hata oluştu."); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void UpdateNote() { int noteID = (int)lstNotes.SelectedValue; Note selected = _noteController.GetByID(noteID); selected.Title = txtTitle.Text; selected.Content = txtContent.Text; bool result = _noteController.Update(selected); if (result) { MessageBox.Show("Güncellendi"); txtTitle.Clear(); txtContent.Clear(); FillNotes(); } else { MessageBox.Show("Güncellenemedi"); } }