Exemplo n.º 1
0
 private void _notesSelectorComponent_EntitySelectionDoubleClick(object sender, ComponentEventArgs <NoteInfoDto> e)
 {
     if (e.Entity == null)
     {
         return;
     }
     _selectedNoteInfo = e.Entity;
     EditNote();
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        private void OnNoteEditorDeleted(NoteInfoDto noteInfo)
        {
            NotesSelectorComponent.DeleteItem(noteInfo);

            if (NotesSelectorComponent.ListEntities?.Count == 0)
            {
                NoteEditorComponent.View.CleanView();
                _selectedNoteInfo = null;
            }
        }
Exemplo n.º 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}");
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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}");
        }
Exemplo n.º 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}");
        }
Exemplo n.º 9
0
 public async Task <Result <NoteDto> > NewAsync(NoteInfoDto entity = null)
 {
     return(await _httpClient.GetFromJsonAsync <Result <NoteDto> >($"api/notes/new"));
 }
Exemplo n.º 10
0
 public async Task <Result <NoteDto> > NewAsync(NoteInfoDto entityInfo = null)
 {
     return(await _repository.Notes.NewAsync(entityInfo));
 }