Initial commit: demo 24.11

This commit is contained in:
328p
2026-11-24 13:33:22 +03:00
commit f795afe894
61 changed files with 2121 additions and 0 deletions
@@ -0,0 +1,18 @@
using System.IO;
namespace RentalApp.Helpers;
public static class LockHelper
{
private static readonly string Path = "lock.txt";
public static void SetLock(DateTime until)
=> File.WriteAllText(Path, until.ToString("o"));
public static DateTime? GetLock()
=> File.Exists(Path) && DateTime.TryParse(File.ReadAllText(Path), out var dt)
? dt : null;
public static bool IsLocked()
=> GetLock() is DateTime dt && dt > DateTime.Now;
}