Beispiel #1
0
 private void _notesSelectorComponent_EntitySelectionDoubleClick(object sender, ComponentEventArgs <NoteInfoDto> e)
 {
     if (e.Entity == null)
     {
         return;
     }
     _selectedNoteInfo = e.Entity;
     EditNote();
 }
Beispiel #2
0
        public async Task <Result <NoteExtendedDto> > NewExtendedAsync(NoteInfoDto entityInfo = null)
        {
            var result = new Result <NoteExtendedDto>();

            var entity = (await _repository.Notes.NewAsync(entityInfo)).Entity.GetSimpleDto <NoteExtendedDto>();

            result.Entity = entity;
            return(result);
        }
Beispiel #3
0
        private void OnNoteEditorDeleted(NoteInfoDto noteInfo)
        {
            NotesSelectorComponent.DeleteItem(noteInfo);

            if (NotesSelectorComponent.ListEntities?.Count == 0)
            {
                NoteEditorComponent.View.CleanView();
                _selectedNoteInfo = null;
            }
        }
Beispiel #4
0
        private async void _notesSelectorComponent_EntitySelection(object sender, ComponentEventArgs <NoteInfoDto> e)
        {
            if (e.Entity == null || SelectedServiceRef == null)
            {
                return;
            }

            NotifyMessage($"Loading note details for note {e.Entity.NoteNumber}");

            _selectedNoteInfo = e.Entity;
            await NoteEditorComponent.LoadModelById(SelectedServiceRef.Service, _selectedNoteInfo.NoteId);

            NotifyMessage($"Loaded note details for note {e.Entity.NoteNumber}");
        }
Beispiel #5
0
        private async void OnNoteEditorSaved(NoteInfoDto noteInfo)
        {
            if (NoteEditorComponent.Model.NoteId == noteInfo.NoteId)
            {
                await NoteEditorComponent.LoadModelById(SelectedServiceRef.Service, noteInfo.NoteId);
            }

            NotesSelectorComponent.RefreshItem(noteInfo);

            if (NotesSelectorComponent.ListEntities?.Count == 0)
            {
                NoteEditorComponent.View.CleanView();
                _selectedNoteInfo = null;
            }
        }
Beispiel #6
0
        private async void OnNoteEditorAdded(NoteInfoDto noteInfo)
        {
            if (NotesSelectorComponent.ListEntities == null)
            {
                return;
            }

            if (NotesSelectorComponent.ListEntities.Count == 0)
            {
                await NoteEditorComponent.LoadModelById(SelectedServiceRef.Service, noteInfo.NoteId);

                _selectedNoteInfo = noteInfo;
            }
            NotesSelectorComponent.AddItem(noteInfo);
        }
Beispiel #7
0
        private async void RefreshActiveFilterWithServiceRef(NotesFilterWithServiceRef notesFilterWithServiceRef)
        {
            SelectMode = EnumSelectMode.Filters;

            NotifyMessage($"Loading notes filter: {notesFilterWithServiceRef?.NotesFilter?.TextSearch}");

            FolderPath = $"Notes filter: {notesFilterWithServiceRef?.NotesFilter?.TextSearch}";

            _selectedNoteInfo = null;
            NoteEditorComponent.View.CleanView();
            await NotesSelectorComponent.LoadFilteredEntities(notesFilterWithServiceRef?.ServiceRef?.Service, notesFilterWithServiceRef?.NotesFilter);

            CountNotes = NotesSelectorComponent.ListEntities?.Count;

            View.ShowInfo(null);
            NotifyMessage($"Loaded notes filter {notesFilterWithServiceRef?.NotesFilter?.TextSearch}");
        }
Beispiel #8
0
        private async void RefreshActiveFolderWithServiceRef(FolderWithServiceRef folderWithServideRef)
        {
            if (folderWithServideRef == null)
            {
                return;
            }

            SelectMode = EnumSelectMode.Folders;

            NotifyMessage($"Loading notes list for folder {folderWithServideRef.FolderInfo?.FolderNumber}");

            FolderPath = FoldersSelectorComponent.Path;

            _selectedNoteInfo = null;
            NoteEditorComponent.CleanView();
            await NotesSelectorComponent.LoadEntities(folderWithServideRef.ServiceRef.Service, folderWithServideRef.FolderInfo);

            CountNotes = NotesSelectorComponent.ListEntities?.Count;

            View.ShowInfo(null);
            NotifyMessage($"Loaded notes list for folder {folderWithServideRef.FolderInfo?.FolderNumber}");
        }
Beispiel #9
0
 public async Task <Result <NoteDto> > NewAsync(NoteInfoDto entity = null)
 {
     return(await _httpClient.GetFromJsonAsync <Result <NoteDto> >($"api/notes/new"));
 }
Beispiel #10
0
 public async Task <Result <NoteDto> > NewAsync(NoteInfoDto entityInfo = null)
 {
     return(await _repository.Notes.NewAsync(entityInfo));
 }