From a47a7a5a3b5d5cdd4627a8248b51c7292e12c2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=83=D1=80=D0=BD=D0=B0=D1=82=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Thu, 19 Mar 2026 23:31:41 +0300 Subject: [PATCH] edit --- XLAB.sln | 34 + XLAB.slnx | 1 + XLAB2/App.xaml | 189 + XLAB2/App.xaml.cs | 72 + XLAB2/AppHost.cs | 36 + XLAB2/AssemblyInfo.cs | 10 + XLAB2/CloneVerificationWindow.xaml | 57 + XLAB2/CloneVerificationWindow.xaml.cs | 20 + XLAB2/CloneVerificationWindowViewModel.cs | 115 + XLAB2/CreateDocumentWindow.xaml | 70 + XLAB2/CreateDocumentWindow.xaml.cs | 20 + XLAB2/CreateDocumentWindowViewModel.cs | 87 + XLAB2/DialogService.cs | 161 + XLAB2/FrpdDirectoryDialogService.cs | 70 + XLAB2/FrpdDirectoryModels.cs | 45 + XLAB2/FrpdDirectoryService.cs | 560 +++ XLAB2/FrpdDirectoryWindow.xaml | 112 + XLAB2/FrpdDirectoryWindow.xaml.cs | 33 + XLAB2/FrpdDirectoryWindowViewModel.cs | 476 ++ XLAB2/FrpdEditWindow.xaml | 48 + XLAB2/FrpdEditWindow.xaml.cs | 20 + XLAB2/FrpdEditWindowViewModel.cs | 174 + XLAB2/FrpdvdEditWindow.xaml | 32 + XLAB2/FrpdvdEditWindow.xaml.cs | 20 + XLAB2/FrpdvdEditWindowViewModel.cs | 103 + XLAB2/Infrastructure/DatabaseConfiguration.cs | 73 + XLAB2/Infrastructure/DatabaseOptions.cs | 32 + .../IDatabaseConnectionFactory.cs | 16 + XLAB2/Infrastructure/SqlAsync.cs | 172 + .../SqlServerConnectionFactory.cs | 68 + XLAB2/MainWindow.xaml | 472 ++ XLAB2/MainWindow.xaml.cs | 101 + XLAB2/MainWindowViewModel.cs | 2499 ++++++++++ XLAB2/MvvmInfrastructure.cs | 152 + XLAB2/PrdspvEditWindow.xaml | 53 + XLAB2/PrdspvEditWindow.xaml.cs | 20 + XLAB2/PrdspvEditWindowViewModel.cs | 157 + XLAB2/PrfrEditWindow.xaml | 91 + XLAB2/PrfrEditWindow.xaml.cs | 20 + XLAB2/PrfrEditWindowViewModel.cs | 243 + XLAB2/PrfrvdEditWindow.xaml | 32 + XLAB2/PrfrvdEditWindow.xaml.cs | 20 + XLAB2/PrfrvdEditWindowViewModel.cs | 103 + XLAB2/PrsnDirectoryDialogService.cs | 94 + XLAB2/PrsnDirectoryModels.cs | 147 + XLAB2/PrsnDirectoryService.cs | 1346 ++++++ XLAB2/PrsnDirectoryWindow.xaml | 199 + XLAB2/PrsnDirectoryWindow.xaml.cs | 33 + XLAB2/PrsnDirectoryWindowViewModel.cs | 790 ++++ XLAB2/PrsnEditWindow.xaml | 69 + XLAB2/PrsnEditWindow.xaml.cs | 20 + XLAB2/PrsnEditWindowViewModel.cs | 237 + XLAB2/PsvDataService.cs | 4196 +++++++++++++++++ XLAB2/PsvModels.cs | 656 +++ XLAB2/PsvPrintService.cs | 587 +++ XLAB2/ReferenceDirectorySqlHelpers.cs | 237 + XLAB2/SelectInstrumentTypeWindow.xaml | 93 + XLAB2/SelectInstrumentTypeWindow.xaml.cs | 20 + XLAB2/SelectInstrumentTypeWindowViewModel.cs | 161 + XLAB2/SelectInstrumentsWindow.xaml | 82 + XLAB2/SelectInstrumentsWindow.xaml.cs | 20 + XLAB2/SelectInstrumentsWindowViewModel.cs | 129 + XLAB2/SpnmtpDirectoryWindow.xaml | 86 + XLAB2/SpnmtpDirectoryWindow.xaml.cs | 21 + XLAB2/SpnmtpDirectoryWindowViewModel.cs | 294 ++ XLAB2/SpnmtpEditWindow.xaml | 64 + XLAB2/SpnmtpEditWindow.xaml.cs | 20 + XLAB2/SpnmtpEditWindowViewModel.cs | 127 + XLAB2/SpoiDirectoryWindow.xaml | 86 + XLAB2/SpoiDirectoryWindow.xaml.cs | 21 + XLAB2/SpoiDirectoryWindowViewModel.cs | 294 ++ XLAB2/SpoiEditWindow.xaml | 65 + XLAB2/SpoiEditWindow.xaml.cs | 20 + XLAB2/SpoiEditWindowViewModel.cs | 148 + XLAB2/TipsEditWindow.xaml | 66 + XLAB2/TipsEditWindow.xaml.cs | 20 + XLAB2/TipsEditWindowViewModel.cs | 239 + XLAB2/TprmcpEditWindow.xaml | 39 + XLAB2/TprmcpEditWindow.xaml.cs | 20 + XLAB2/TprmcpEditWindowViewModel.cs | 99 + XLAB2/TprmkEditWindow.xaml | 53 + XLAB2/TprmkEditWindow.xaml.cs | 20 + XLAB2/TprmkEditWindowViewModel.cs | 153 + XLAB2/TprzEditWindow.xaml | 46 + XLAB2/TprzEditWindow.xaml.cs | 20 + XLAB2/TprzEditWindowViewModel.cs | 92 + XLAB2/TpvdklEditWindow.xaml | 40 + XLAB2/TpvdklEditWindow.xaml.cs | 20 + XLAB2/TpvdklEditWindowViewModel.cs | 66 + XLAB2/TpvdklWindow.xaml | 68 + XLAB2/TpvdklWindow.xaml.cs | 33 + XLAB2/TpvdklWindowViewModel.cs | 145 + XLAB2/TypeSizeDialogService.cs | 115 + XLAB2/TypeSizeDirectoryModels.cs | 191 + XLAB2/TypeSizeDirectoryService.cs | 1884 ++++++++ XLAB2/TypeSizeDirectoryWindow.xaml | 188 + XLAB2/TypeSizeDirectoryWindow.xaml.cs | 33 + XLAB2/TypeSizeDirectoryWindowViewModel.cs | 664 +++ XLAB2/VerificationEditWindow.xaml | 122 + XLAB2/VerificationEditWindow.xaml.cs | 20 + XLAB2/VerificationEditWindowViewModel.cs | 210 + XLAB2/XLAB2.csproj | 44 + XLAB2/XLAB2.slnx | 3 + XLAB2/appsettings.json | 18 + 104 files changed, 21982 insertions(+) create mode 100644 XLAB2/App.xaml create mode 100644 XLAB2/App.xaml.cs create mode 100644 XLAB2/AppHost.cs create mode 100644 XLAB2/AssemblyInfo.cs create mode 100644 XLAB2/CloneVerificationWindow.xaml create mode 100644 XLAB2/CloneVerificationWindow.xaml.cs create mode 100644 XLAB2/CloneVerificationWindowViewModel.cs create mode 100644 XLAB2/CreateDocumentWindow.xaml create mode 100644 XLAB2/CreateDocumentWindow.xaml.cs create mode 100644 XLAB2/CreateDocumentWindowViewModel.cs create mode 100644 XLAB2/DialogService.cs create mode 100644 XLAB2/FrpdDirectoryDialogService.cs create mode 100644 XLAB2/FrpdDirectoryModels.cs create mode 100644 XLAB2/FrpdDirectoryService.cs create mode 100644 XLAB2/FrpdDirectoryWindow.xaml create mode 100644 XLAB2/FrpdDirectoryWindow.xaml.cs create mode 100644 XLAB2/FrpdDirectoryWindowViewModel.cs create mode 100644 XLAB2/FrpdEditWindow.xaml create mode 100644 XLAB2/FrpdEditWindow.xaml.cs create mode 100644 XLAB2/FrpdEditWindowViewModel.cs create mode 100644 XLAB2/FrpdvdEditWindow.xaml create mode 100644 XLAB2/FrpdvdEditWindow.xaml.cs create mode 100644 XLAB2/FrpdvdEditWindowViewModel.cs create mode 100644 XLAB2/Infrastructure/DatabaseConfiguration.cs create mode 100644 XLAB2/Infrastructure/DatabaseOptions.cs create mode 100644 XLAB2/Infrastructure/IDatabaseConnectionFactory.cs create mode 100644 XLAB2/Infrastructure/SqlAsync.cs create mode 100644 XLAB2/Infrastructure/SqlServerConnectionFactory.cs create mode 100644 XLAB2/MainWindow.xaml create mode 100644 XLAB2/MainWindow.xaml.cs create mode 100644 XLAB2/MainWindowViewModel.cs create mode 100644 XLAB2/MvvmInfrastructure.cs create mode 100644 XLAB2/PrdspvEditWindow.xaml create mode 100644 XLAB2/PrdspvEditWindow.xaml.cs create mode 100644 XLAB2/PrdspvEditWindowViewModel.cs create mode 100644 XLAB2/PrfrEditWindow.xaml create mode 100644 XLAB2/PrfrEditWindow.xaml.cs create mode 100644 XLAB2/PrfrEditWindowViewModel.cs create mode 100644 XLAB2/PrfrvdEditWindow.xaml create mode 100644 XLAB2/PrfrvdEditWindow.xaml.cs create mode 100644 XLAB2/PrfrvdEditWindowViewModel.cs create mode 100644 XLAB2/PrsnDirectoryDialogService.cs create mode 100644 XLAB2/PrsnDirectoryModels.cs create mode 100644 XLAB2/PrsnDirectoryService.cs create mode 100644 XLAB2/PrsnDirectoryWindow.xaml create mode 100644 XLAB2/PrsnDirectoryWindow.xaml.cs create mode 100644 XLAB2/PrsnDirectoryWindowViewModel.cs create mode 100644 XLAB2/PrsnEditWindow.xaml create mode 100644 XLAB2/PrsnEditWindow.xaml.cs create mode 100644 XLAB2/PrsnEditWindowViewModel.cs create mode 100644 XLAB2/PsvDataService.cs create mode 100644 XLAB2/PsvModels.cs create mode 100644 XLAB2/PsvPrintService.cs create mode 100644 XLAB2/ReferenceDirectorySqlHelpers.cs create mode 100644 XLAB2/SelectInstrumentTypeWindow.xaml create mode 100644 XLAB2/SelectInstrumentTypeWindow.xaml.cs create mode 100644 XLAB2/SelectInstrumentTypeWindowViewModel.cs create mode 100644 XLAB2/SelectInstrumentsWindow.xaml create mode 100644 XLAB2/SelectInstrumentsWindow.xaml.cs create mode 100644 XLAB2/SelectInstrumentsWindowViewModel.cs create mode 100644 XLAB2/SpnmtpDirectoryWindow.xaml create mode 100644 XLAB2/SpnmtpDirectoryWindow.xaml.cs create mode 100644 XLAB2/SpnmtpDirectoryWindowViewModel.cs create mode 100644 XLAB2/SpnmtpEditWindow.xaml create mode 100644 XLAB2/SpnmtpEditWindow.xaml.cs create mode 100644 XLAB2/SpnmtpEditWindowViewModel.cs create mode 100644 XLAB2/SpoiDirectoryWindow.xaml create mode 100644 XLAB2/SpoiDirectoryWindow.xaml.cs create mode 100644 XLAB2/SpoiDirectoryWindowViewModel.cs create mode 100644 XLAB2/SpoiEditWindow.xaml create mode 100644 XLAB2/SpoiEditWindow.xaml.cs create mode 100644 XLAB2/SpoiEditWindowViewModel.cs create mode 100644 XLAB2/TipsEditWindow.xaml create mode 100644 XLAB2/TipsEditWindow.xaml.cs create mode 100644 XLAB2/TipsEditWindowViewModel.cs create mode 100644 XLAB2/TprmcpEditWindow.xaml create mode 100644 XLAB2/TprmcpEditWindow.xaml.cs create mode 100644 XLAB2/TprmcpEditWindowViewModel.cs create mode 100644 XLAB2/TprmkEditWindow.xaml create mode 100644 XLAB2/TprmkEditWindow.xaml.cs create mode 100644 XLAB2/TprmkEditWindowViewModel.cs create mode 100644 XLAB2/TprzEditWindow.xaml create mode 100644 XLAB2/TprzEditWindow.xaml.cs create mode 100644 XLAB2/TprzEditWindowViewModel.cs create mode 100644 XLAB2/TpvdklEditWindow.xaml create mode 100644 XLAB2/TpvdklEditWindow.xaml.cs create mode 100644 XLAB2/TpvdklEditWindowViewModel.cs create mode 100644 XLAB2/TpvdklWindow.xaml create mode 100644 XLAB2/TpvdklWindow.xaml.cs create mode 100644 XLAB2/TpvdklWindowViewModel.cs create mode 100644 XLAB2/TypeSizeDialogService.cs create mode 100644 XLAB2/TypeSizeDirectoryModels.cs create mode 100644 XLAB2/TypeSizeDirectoryService.cs create mode 100644 XLAB2/TypeSizeDirectoryWindow.xaml create mode 100644 XLAB2/TypeSizeDirectoryWindow.xaml.cs create mode 100644 XLAB2/TypeSizeDirectoryWindowViewModel.cs create mode 100644 XLAB2/VerificationEditWindow.xaml create mode 100644 XLAB2/VerificationEditWindow.xaml.cs create mode 100644 XLAB2/VerificationEditWindowViewModel.cs create mode 100644 XLAB2/XLAB2.csproj create mode 100644 XLAB2/XLAB2.slnx create mode 100644 XLAB2/appsettings.json diff --git a/XLAB.sln b/XLAB.sln index 50ba80c..9379f38 100644 --- a/XLAB.sln +++ b/XLAB.sln @@ -5,20 +5,54 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XLAB.DATA", "XLAB.DATA\XLAB EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XLAB", "XLAB\XLAB.csproj", "{B8DAAB84-777A-4274-8452-E602DB1AF587}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XLAB2", "XLAB2\XLAB2.csproj", "{6B248955-05FF-43E9-B038-5CD501D21442}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {AE0E35D7-DFA4-4150-9889-255043B232BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AE0E35D7-DFA4-4150-9889-255043B232BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Debug|x64.ActiveCfg = Debug|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Debug|x64.Build.0 = Debug|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Debug|x86.ActiveCfg = Debug|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Debug|x86.Build.0 = Debug|Any CPU {AE0E35D7-DFA4-4150-9889-255043B232BB}.Release|Any CPU.ActiveCfg = Release|Any CPU {AE0E35D7-DFA4-4150-9889-255043B232BB}.Release|Any CPU.Build.0 = Release|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Release|x64.ActiveCfg = Release|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Release|x64.Build.0 = Release|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Release|x86.ActiveCfg = Release|Any CPU + {AE0E35D7-DFA4-4150-9889-255043B232BB}.Release|x86.Build.0 = Release|Any CPU {B8DAAB84-777A-4274-8452-E602DB1AF587}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B8DAAB84-777A-4274-8452-E602DB1AF587}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Debug|x64.ActiveCfg = Debug|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Debug|x64.Build.0 = Debug|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Debug|x86.ActiveCfg = Debug|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Debug|x86.Build.0 = Debug|Any CPU {B8DAAB84-777A-4274-8452-E602DB1AF587}.Release|Any CPU.ActiveCfg = Release|Any CPU {B8DAAB84-777A-4274-8452-E602DB1AF587}.Release|Any CPU.Build.0 = Release|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Release|x64.ActiveCfg = Release|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Release|x64.Build.0 = Release|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Release|x86.ActiveCfg = Release|Any CPU + {B8DAAB84-777A-4274-8452-E602DB1AF587}.Release|x86.Build.0 = Release|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Debug|x64.ActiveCfg = Debug|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Debug|x64.Build.0 = Debug|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Debug|x86.ActiveCfg = Debug|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Debug|x86.Build.0 = Debug|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Release|Any CPU.Build.0 = Release|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Release|x64.ActiveCfg = Release|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Release|x64.Build.0 = Release|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Release|x86.ActiveCfg = Release|Any CPU + {6B248955-05FF-43E9-B038-5CD501D21442}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/XLAB.slnx b/XLAB.slnx index 5b5d087..6da51ee 100644 --- a/XLAB.slnx +++ b/XLAB.slnx @@ -1,4 +1,5 @@ + diff --git a/XLAB2/App.xaml b/XLAB2/App.xaml new file mode 100644 index 0000000..f66582e --- /dev/null +++ b/XLAB2/App.xaml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XLAB2/App.xaml.cs b/XLAB2/App.xaml.cs new file mode 100644 index 0000000..4da3e08 --- /dev/null +++ b/XLAB2/App.xaml.cs @@ -0,0 +1,72 @@ +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Markup; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using XLAB2.Infrastructure; + +namespace XLAB2 +{ + public partial class App : Application + { + private IHost _host; + + public App() + { + ApplyRussianCulture(); + } + + protected override async void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + + try + { + _host = AppHost.Create(); + await _host.StartAsync().ConfigureAwait(true); + + MainWindow = _host.Services.GetRequiredService(); + MainWindow.Show(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "XLAB2", MessageBoxButton.OK, MessageBoxImage.Error); + Shutdown(-1); + } + } + + protected override async void OnExit(ExitEventArgs e) + { + if (_host != null) + { + try + { + await _host.StopAsync(TimeSpan.FromSeconds(5)).ConfigureAwait(true); + } + finally + { + _host.Dispose(); + } + } + + base.OnExit(e); + } + + private static void ApplyRussianCulture() + { + var culture = new CultureInfo("ru-RU"); + + CultureInfo.DefaultThreadCurrentCulture = culture; + CultureInfo.DefaultThreadCurrentUICulture = culture; + Thread.CurrentThread.CurrentCulture = culture; + Thread.CurrentThread.CurrentUICulture = culture; + + FrameworkElement.LanguageProperty.OverrideMetadata( + typeof(FrameworkElement), + new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(culture.IetfLanguageTag))); + } + } +} diff --git a/XLAB2/AppHost.cs b/XLAB2/AppHost.cs new file mode 100644 index 0000000..c1d748f --- /dev/null +++ b/XLAB2/AppHost.cs @@ -0,0 +1,36 @@ +using System; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using XLAB2.Infrastructure; + +namespace XLAB2 +{ + internal static class AppHost + { + public static IHost Create() + { + return Host.CreateDefaultBuilder() + .UseContentRoot(AppContext.BaseDirectory) + .ConfigureAppConfiguration((context, config) => + { + config.Sources.Clear(); + config.SetBasePath(AppContext.BaseDirectory); + config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); + config.AddEnvironmentVariables(); + }) + .ConfigureServices((_, services) => + { + services.AddSingleton(_ => SqlServerConnectionFactory.Current); + services.AddTransient(); + services.AddTransient(provider => new MainWindow(provider.GetRequiredService())); + }) + .UseDefaultServiceProvider((_, options) => + { + options.ValidateOnBuild = true; + options.ValidateScopes = true; + }) + .Build(); + } + } +} diff --git a/XLAB2/AssemblyInfo.cs b/XLAB2/AssemblyInfo.cs new file mode 100644 index 0000000..cc29e7f --- /dev/null +++ b/XLAB2/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/XLAB2/CloneVerificationWindow.xaml b/XLAB2/CloneVerificationWindow.xaml new file mode 100644 index 0000000..dec575d --- /dev/null +++ b/XLAB2/CloneVerificationWindow.xaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + +