From c1f0c8714f638526ce1d2a19875e153f86459794 Mon Sep 17 00:00:00 2001 From: retr0volkov <68907954+retr0volkov@users.noreply.github.com> Date: Wed, 30 Jul 2025 13:10:25 +0300 Subject: [PATCH] Added validation for `InspectionDate` and set a maximum year restriction in `InspectionView`. --- ViewModels/Basic/InspectionViewModel.cs | 2 ++ Views/InspectionView.axaml | 2 +- obj/Debug/net8.0/Avalonia/resources | Bin 462311 -> 462332 bytes obj/Debug/net8.0/GazpromApp.AssemblyInfo.cs | 15 ++++++++------- .../GazpromApp.AssemblyInfoInputs.cache | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ViewModels/Basic/InspectionViewModel.cs b/ViewModels/Basic/InspectionViewModel.cs index 1a18eea..5f067e2 100644 --- a/ViewModels/Basic/InspectionViewModel.cs +++ b/ViewModels/Basic/InspectionViewModel.cs @@ -66,6 +66,8 @@ public partial class InspectionViewModel : ViewModelBase { Inspection.Name = Name; Inspection.CreationDate = CreationDate; + if (InspectionDate.Year > 2500) + InspectionDate = DateTimeOffset.Now; Inspection.InspectionDate = InspectionDate; Inspection.PeriodType = PeriodType.ToDescription(); Inspection.PeriodValue = PeriodValue; diff --git a/Views/InspectionView.axaml b/Views/InspectionView.axaml index 20a7939..4c425a0 100644 --- a/Views/InspectionView.axaml +++ b/Views/InspectionView.axaml @@ -32,7 +32,7 @@ - diff --git a/obj/Debug/net8.0/Avalonia/resources b/obj/Debug/net8.0/Avalonia/resources index 6fea3645fa1cab7893f3a3f7275194605e6a9b9f..15ba66021e2aecf61b22b28236ecdc8198edfdc8 100644 GIT binary patch delta 108 zcmaDpTjtMfnGJI|7*!|F<&b84J$WaG9OK)`H#iiTINnbF&7sU#JXxMoiLs~IiL>2_ zlM#rSfS4JGS%8>zyAvndk8>glzKIo)sfk6lN=Bvz2D%1@Ks5d0bT-N9_P5wLwnyDy H>oo-c$;~4S delta 87 zcmew}Tju#}nGJI|7zHNJ<&b8)HhCw99OI42H#iiTKEIj#n?so~Zn8Y55@UI@6KA^< nCnFFu0WmWWvj8#cb|+4@ALpjmzhD!Y9&n3|XM6q)wq8>JY+fFO diff --git a/obj/Debug/net8.0/GazpromApp.AssemblyInfo.cs b/obj/Debug/net8.0/GazpromApp.AssemblyInfo.cs index df49297..eac2104 100644 --- a/obj/Debug/net8.0/GazpromApp.AssemblyInfo.cs +++ b/obj/Debug/net8.0/GazpromApp.AssemblyInfo.cs @@ -7,15 +7,16 @@ // //------------------------------------------------------------------------------ +using System; using System.Reflection; -[assembly: AssemblyCompany("GazpromApp")] -[assembly: AssemblyConfiguration("Debug")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: AssemblyInformationalVersion("1.0.0+edae732facddad296bc2957b70d69e109c8df0dc")] -[assembly: AssemblyProduct("GazpromApp")] -[assembly: AssemblyTitle("GazpromApp")] -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: System.Reflection.AssemblyCompanyAttribute("GazpromApp")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+08eaa30209fb07132671006392af33044278fb88")] +[assembly: System.Reflection.AssemblyProductAttribute("GazpromApp")] +[assembly: System.Reflection.AssemblyTitleAttribute("GazpromApp")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] // Generated by the MSBuild WriteCodeFragment class. diff --git a/obj/Debug/net8.0/GazpromApp.AssemblyInfoInputs.cache b/obj/Debug/net8.0/GazpromApp.AssemblyInfoInputs.cache index d806021..e895b48 100644 --- a/obj/Debug/net8.0/GazpromApp.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0/GazpromApp.AssemblyInfoInputs.cache @@ -1 +1 @@ -d5e1f758b4af1a11eec5b0ef10074d2fa0359670b43f632e44e63e702c71cb03 +991b92f7461b0b0cb8dff258086ca1dd3fd0a9b1938281c5774aefca5ef9edfc