示例#1
0
 private void imgDelete_MouseUp(object sender, MouseButtonEventArgs e)
 {
     if (_note.State == NoteState.New || System.Windows.MessageBox.Show("Are you sure you wish to remove the note: '" + _note.Title + "'?", "OP.Notes", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         _note.Delete();
     }
 }
示例#2
0
        public async Task <IActionResult> RemoveNote(int noteId)
        {
            try
            {
                await _noteService.Delete(noteId, GetUserId());

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
示例#3
0
            public async Task <bool> Handle(Request request, CancellationToken cancellationToken)
            {
                bool result = false;

                try
                {
                    result = await Task.FromResult(noteModule.Delete(request.Text));
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return(result);
            }
示例#4
0
 public void Delete(Guid id)
 {
     Log.Instance.Info("Удаление заметки с  ID {0}", id);
     _notesRepository.Delete(id);
 }