From 8c06bdd0c5d07246fb0c69b80c5b43b2ae503c0d Mon Sep 17 00:00:00 2001 From: Anastasia Date: Mon, 23 Dec 2024 13:35:07 +0300 Subject: [PATCH] init commit --- .../ViewModels/PresenceViewModel.cs | 22 +++- Presence.Desktop/Views/PresenceView.axaml | 9 +- Presence.Desktop/Views/PresenceView.axaml.cs | 14 ++ .../bin/Debug/net8.0/Presence.Desktop.dll | Bin 242176 -> 243712 bytes .../bin/Debug/net8.0/Presence.Desktop.exe | Bin 143360 -> 143360 bytes .../bin/Debug/net8.0/Presence.Desktop.pdb | Bin 26164 -> 26276 bytes Presence.Desktop/bin/Debug/net8.0/data.dll | Bin 34816 -> 35328 bytes Presence.Desktop/bin/Debug/net8.0/data.pdb | Bin 20148 -> 20272 bytes Presence.Desktop/bin/Debug/net8.0/domain.dll | Bin 22016 -> 22016 bytes Presence.Desktop/bin/Debug/net8.0/domain.pdb | Bin 18376 -> 18420 bytes .../net8.0/Avalonia/Presence.Desktop.dll | Bin 242176 -> 243712 bytes .../net8.0/Avalonia/Presence.Desktop.pdb | Bin 26164 -> 26276 bytes .../net8.0/Avalonia/Resources.Inputs.cache | 2 +- .../obj/Debug/net8.0/Avalonia/references | 118 ++++++++--------- .../obj/Debug/net8.0/Avalonia/resources | Bin 185798 -> 185976 bytes .../net8.0/Presence.Desktop.AssemblyInfo.cs | 2 +- .../Presence.Desktop.AssemblyInfoInputs.cache | 2 +- ....GeneratedMSBuildEditorConfig.editorconfig | 12 +- .../net8.0/Presence.Desktop.assets.cache | Bin 39839 -> 39839 bytes ...nce.Desktop.csproj.AssemblyReference.cache | Bin 33938 -> 33954 bytes ...nce.Desktop.csproj.CoreCompileInputs.cache | 2 +- ...esence.Desktop.csproj.FileListAbsolute.txt | 99 ++++++++++++++ .../obj/Debug/net8.0/Presence.Desktop.dll | Bin 215040 -> 0 bytes .../Presence.Desktop.genruntimeconfig.cache | 2 +- .../obj/Debug/net8.0/Presence.Desktop.pdb | Bin 24120 -> 0 bytes Presence.Desktop/obj/Debug/net8.0/apphost.exe | Bin 143360 -> 143360 bytes .../obj/Debug/net8.0/ref/Presence.Desktop.dll | Bin 12800 -> 13312 bytes .../refint/Avalonia/Presence.Desktop.dll | Bin 12800 -> 13312 bytes .../Debug/net8.0/refint/Presence.Desktop.dll | Bin 13824 -> 0 bytes .../Presence.Desktop.csproj.nuget.dgspec.json | 53 ++++---- .../obj/Presence.Desktop.csproj.nuget.g.props | 8 +- Presence.Desktop/obj/project.assets.json | 21 +-- Presence.Desktop/obj/project.nuget.cache | 122 +++++++++--------- .../Debug/net8.0/console_ui.AssemblyInfo.cs | 2 +- .../console_ui.AssemblyInfoInputs.cache | 2 +- ....GeneratedMSBuildEditorConfig.editorconfig | 2 +- .../obj/Debug/net8.0/console_ui.assets.cache | Bin 15046 -> 15046 bytes .../console_ui.csproj.AssemblyReference.cache | Bin 16451 -> 14492 bytes .../obj/console_ui.csproj.nuget.dgspec.json | 74 ++++++----- .../obj/console_ui.csproj.nuget.g.props | 4 +- console_ui/obj/project.assets.json | 25 ++-- console_ui/obj/project.nuget.cache | 50 +++---- data/Repository/IPresenceRepository.cs | 2 + data/Repository/SQLPresenceRepositoryImpl.cs | 13 ++ data/bin/Debug/net8.0/data.dll | Bin 34816 -> 35328 bytes data/bin/Debug/net8.0/data.pdb | Bin 20148 -> 20272 bytes data/obj/Debug/net8.0/data.AssemblyInfo.cs | 2 +- .../net8.0/data.AssemblyInfoInputs.cache | 2 +- ....GeneratedMSBuildEditorConfig.editorconfig | 2 +- data/obj/Debug/net8.0/data.assets.cache | Bin 37208 -> 37208 bytes .../net8.0/data.csproj.FileListAbsolute.txt | 14 ++ data/obj/Debug/net8.0/data.dll | Bin 34816 -> 35328 bytes .../Debug/net8.0/data.genruntimeconfig.cache | 2 +- data/obj/Debug/net8.0/data.pdb | Bin 20148 -> 20272 bytes data/obj/Debug/net8.0/ref/data.dll | Bin 14848 -> 14848 bytes data/obj/Debug/net8.0/refint/data.dll | Bin 14848 -> 14848 bytes data/obj/data.csproj.nuget.dgspec.json | 15 ++- data/obj/data.csproj.nuget.g.props | 6 +- data/obj/project.assets.json | 13 +- data/obj/project.nuget.cache | 80 ++++++------ domain/UseCase/UseCaseGeneratePresence.cs | 5 +- domain/bin/Debug/net8.0/data.dll | Bin 34816 -> 35328 bytes domain/bin/Debug/net8.0/data.pdb | Bin 20148 -> 20272 bytes domain/bin/Debug/net8.0/domain.dll | Bin 22016 -> 22016 bytes domain/bin/Debug/net8.0/domain.pdb | Bin 18376 -> 18420 bytes .../obj/Debug/net8.0/domain.AssemblyInfo.cs | 2 +- .../net8.0/domain.AssemblyInfoInputs.cache | 2 +- ....GeneratedMSBuildEditorConfig.editorconfig | 2 +- domain/obj/Debug/net8.0/domain.assets.cache | Bin 14690 -> 14690 bytes .../domain.csproj.AssemblyReference.cache | Bin 14589 -> 14597 bytes .../domain.csproj.CoreCompileInputs.cache | 2 +- .../net8.0/domain.csproj.FileListAbsolute.txt | 15 +++ domain/obj/Debug/net8.0/domain.dll | Bin 22016 -> 22016 bytes domain/obj/Debug/net8.0/domain.pdb | Bin 18376 -> 18420 bytes domain/obj/Debug/net8.0/ref/domain.dll | Bin 10240 -> 10240 bytes domain/obj/Debug/net8.0/refint/domain.dll | Bin 10240 -> 10240 bytes domain/obj/domain.csproj.nuget.dgspec.json | 32 ++--- domain/obj/domain.csproj.nuget.g.props | 4 +- domain/obj/project.assets.json | 17 +-- domain/obj/project.nuget.cache | 50 +++---- .../Debug/net8.0/presence_api.AssemblyInfo.cs | 2 +- .../presence_api.AssemblyInfoInputs.cache | 2 +- ....GeneratedMSBuildEditorConfig.editorconfig | 4 +- .../Debug/net8.0/presence_api.assets.cache | Bin 18611 -> 18611 bytes ...resence_api.csproj.AssemblyReference.cache | Bin 14600 -> 14616 bytes .../obj/presence_api.csproj.nuget.dgspec.json | 49 +++---- .../obj/presence_api.csproj.nuget.g.props | 6 +- presence_api/obj/project.assets.json | 17 +-- presence_api/obj/project.nuget.cache | 64 ++++----- ui/obj/Debug/net8.0/ui.AssemblyInfo.cs | 2 +- .../Debug/net8.0/ui.AssemblyInfoInputs.cache | 2 +- ....GeneratedMSBuildEditorConfig.editorconfig | 2 +- ui/obj/Debug/net8.0/ui.assets.cache | Bin 14558 -> 14558 bytes .../net8.0/ui.csproj.AssemblyReference.cache | Bin 15398 -> 14189 bytes ui/obj/project.assets.json | 17 +-- ui/obj/project.nuget.cache | 50 +++---- ui/obj/ui.csproj.nuget.dgspec.json | 49 +++---- ui/obj/ui.csproj.nuget.g.props | 4 +- 98 files changed, 702 insertions(+), 497 deletions(-) delete mode 100644 Presence.Desktop/obj/Debug/net8.0/Presence.Desktop.dll delete mode 100644 Presence.Desktop/obj/Debug/net8.0/Presence.Desktop.pdb delete mode 100644 Presence.Desktop/obj/Debug/net8.0/refint/Presence.Desktop.dll diff --git a/Presence.Desktop/ViewModels/PresenceViewModel.cs b/Presence.Desktop/ViewModels/PresenceViewModel.cs index 2c75302..38083b9 100644 --- a/Presence.Desktop/ViewModels/PresenceViewModel.cs +++ b/Presence.Desktop/ViewModels/PresenceViewModel.cs @@ -6,6 +6,7 @@ using ReactiveUI; using System; using System.Collections.ObjectModel; using System.Globalization; +using System.Linq; using System.Reactive; namespace Presence.Desktop.ViewModels @@ -43,7 +44,15 @@ namespace Presence.Desktop.ViewModels } } + private ObservableCollection _selectedItems = new(); + public ObservableCollection SelectedItems + { + get => _selectedItems; + set => this.RaiseAndSetIfChanged(ref _selectedItems, value); + } + public ReactiveCommand NavigateBackCommand { get; } + public ReactiveCommand DeleteSelectedItemsCommand { get; } public PresenceViewModel(IScreen hostScreen, GroupUseCase groupUseCase, UseCaseGeneratePresence presenceUseCase) { @@ -52,6 +61,7 @@ namespace Presence.Desktop.ViewModels HostScreen = hostScreen; NavigateBackCommand = ReactiveCommand.Create(() => { }); + DeleteSelectedItemsCommand = ReactiveCommand.Create(DeleteSelectedItems); LoadGroups(); } @@ -91,6 +101,16 @@ namespace Presence.Desktop.ViewModels _presenceUseCase.UpdateAttendance(presence); } - + private void DeleteSelectedItems() + { + if (SelectedItems.Any()) + { + foreach (var item in SelectedItems.ToList()) + { + _presenceUseCase.DeletePresence(item); // Удаляем из базы данных + AttendanceRecords.Remove(item); // Удаляем из коллекции + } + } + } } } \ No newline at end of file diff --git a/Presence.Desktop/Views/PresenceView.axaml b/Presence.Desktop/Views/PresenceView.axaml index 5980d99..09eb6ad 100644 --- a/Presence.Desktop/Views/PresenceView.axaml +++ b/Presence.Desktop/Views/PresenceView.axaml @@ -23,15 +23,18 @@ - + - - + + +