commit dd6cd84a0dc32a714d6d13bc89f5a8076ad9a67d Author: kto765 Date: Wed Feb 5 13:47:39 2025 +0300 1 экран diff --git a/App.axaml b/App.axaml new file mode 100644 index 0000000..99e97a8 --- /dev/null +++ b/App.axaml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/App.axaml.cs b/App.axaml.cs new file mode 100644 index 0000000..42a0590 --- /dev/null +++ b/App.axaml.cs @@ -0,0 +1,23 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace Blagodat; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new Registration(); + } + + base.OnFrameworkInitializationCompleted(); + } +} \ No newline at end of file diff --git a/Blagodat.csproj b/Blagodat.csproj new file mode 100644 index 0000000..f47757c --- /dev/null +++ b/Blagodat.csproj @@ -0,0 +1,29 @@ + + + WinExe + net9.0 + enable + true + app.manifest + true + + + + + + + + + + + None + All + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/Blagodat.sln b/Blagodat.sln new file mode 100644 index 0000000..e0bb1e4 --- /dev/null +++ b/Blagodat.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35514.174 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blagodat", "Blagodat.csproj", "{FECC1AE0-6656-4657-8763-B25A62C978C3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FECC1AE0-6656-4657-8763-B25A62C978C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FECC1AE0-6656-4657-8763-B25A62C978C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FECC1AE0-6656-4657-8763-B25A62C978C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FECC1AE0-6656-4657-8763-B25A62C978C3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/MainWindow.axaml b/MainWindow.axaml new file mode 100644 index 0000000..5915046 --- /dev/null +++ b/MainWindow.axaml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs new file mode 100644 index 0000000..bea2de5 --- /dev/null +++ b/MainWindow.axaml.cs @@ -0,0 +1,16 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.Markup.Xaml; +using ReactiveUI; + +namespace Blagodat; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + new Registration().Show(); + } +} \ No newline at end of file diff --git a/Models/Client.cs b/Models/Client.cs new file mode 100644 index 0000000..2cd07b3 --- /dev/null +++ b/Models/Client.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace Blagodat.Models; + +public partial class Client +{ + public int ClientId { get; set; } + + public string? Fio { get; set; } + + public int? CodeClient { get; set; } + + public string PassportData { get; set; } = null!; + + public DateOnly? DateOfBirth { get; set; } + + public string? Address { get; set; } + + public string? EMail { get; set; } + + public string? Password { get; set; } +} diff --git a/Models/Order.cs b/Models/Order.cs new file mode 100644 index 0000000..2b72d36 --- /dev/null +++ b/Models/Order.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace Blagodat.Models; + +public partial class Order +{ + public int IdOrder { get; set; } + + public int ClientCode { get; set; } + + public DateOnly DateOfCreation { get; set; } + + public TimeOnly OrderTime { get; set; } + + public string Status { get; set; } = null!; + + public DateOnly? ClosingDate { get; set; } + + public int RentalTimeMin { get; set; } + + public virtual ICollection OrdersAndServices { get; set; } = new List(); +} diff --git a/Models/OrdersAndService.cs b/Models/OrdersAndService.cs new file mode 100644 index 0000000..08e7545 --- /dev/null +++ b/Models/OrdersAndService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace Blagodat.Models; + +public partial class OrdersAndService +{ + public int IdOrdersAndServices { get; set; } + + public int? Order { get; set; } + + public int? Service { get; set; } + + public virtual Order? OrderNavigation { get; set; } + + public virtual Service? ServiceNavigation { get; set; } +} diff --git a/Models/Service.cs b/Models/Service.cs new file mode 100644 index 0000000..1bfcba9 --- /dev/null +++ b/Models/Service.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace Blagodat.Models; + +public partial class Service +{ + public int IdServices { get; set; } + + public string? NameServices { get; set; } + + public string? CodeServices { get; set; } + + public decimal? CostPerHour { get; set; } + + public virtual ICollection OrdersAndServices { get; set; } = new List(); +} diff --git a/Models/Staff.cs b/Models/Staff.cs new file mode 100644 index 0000000..45228b9 --- /dev/null +++ b/Models/Staff.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace Blagodat.Models; + +public partial class Staff +{ + public string IdStaff { get; set; } = null!; + + public string? Post { get; set; } + + public string? Fio { get; set; } + + public string? Login { get; set; } + + public string? Password { get; set; } + + public DateOnly? LastLoginDate { get; set; } + + public TimeOnly? LastLoginTime { get; set; } + + public bool? TypeOfEntrance { get; set; } +} diff --git a/Models/User7Context.cs b/Models/User7Context.cs new file mode 100644 index 0000000..8f8a134 --- /dev/null +++ b/Models/User7Context.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore; + +namespace Blagodat.Models; + +public partial class User7Context : DbContext +{ + public User7Context() + { + } + + public User7Context(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet Clients { get; set; } + + public virtual DbSet Orders { get; set; } + + public virtual DbSet OrdersAndServices { get; set; } + + public virtual DbSet Services { get; set; } + + public virtual DbSet Staff { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) +#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263. + => optionsBuilder.UseNpgsql("Host=45.67.56.214;Port=5421;Database=user7;Username=user7;Password=a8yLONBC"); + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ClientId).HasName("clients_pk"); + + entity.ToTable("clients", "blagodat"); + + entity.Property(e => e.ClientId) + .UseIdentityAlwaysColumn() + .HasColumnName("client_id"); + entity.Property(e => e.Address) + .HasColumnType("character varying") + .HasColumnName("address"); + entity.Property(e => e.CodeClient).HasColumnName("code_client"); + entity.Property(e => e.DateOfBirth).HasColumnName("date_of_birth"); + entity.Property(e => e.EMail) + .HasColumnType("character varying") + .HasColumnName("e-mail"); + entity.Property(e => e.Fio) + .HasColumnType("character varying") + .HasColumnName("fio"); + entity.Property(e => e.PassportData) + .HasColumnType("character varying") + .HasColumnName("passport_data"); + entity.Property(e => e.Password) + .HasColumnType("character varying") + .HasColumnName("password"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdOrder).HasName("orders_pkey"); + + entity.ToTable("orders", "blagodat"); + + entity.Property(e => e.IdOrder) + .UseIdentityAlwaysColumn() + .HasColumnName("id_order"); + entity.Property(e => e.ClientCode).HasColumnName("client_code"); + entity.Property(e => e.ClosingDate).HasColumnName("closing_date"); + entity.Property(e => e.DateOfCreation).HasColumnName("date_of_creation"); + entity.Property(e => e.OrderTime).HasColumnName("order_time"); + entity.Property(e => e.RentalTimeMin).HasColumnName("rental_time_min"); + entity.Property(e => e.Status) + .HasColumnType("character varying") + .HasColumnName("status"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdOrdersAndServices).HasName("orders_and_services_pk"); + + entity.ToTable("orders_and_services", "blagodat"); + + entity.Property(e => e.IdOrdersAndServices) + .UseIdentityAlwaysColumn() + .HasColumnName("id_orders_and_services"); + entity.Property(e => e.Order).HasColumnName("order"); + entity.Property(e => e.Service).HasColumnName("service"); + + entity.HasOne(d => d.OrderNavigation).WithMany(p => p.OrdersAndServices) + .HasForeignKey(d => d.Order) + .HasConstraintName("orders_and_services_orders_fk"); + + entity.HasOne(d => d.ServiceNavigation).WithMany(p => p.OrdersAndServices) + .HasForeignKey(d => d.Service) + .HasConstraintName("orders_and_services_services_fk"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdServices).HasName("services_pk"); + + entity.ToTable("services", "blagodat"); + + entity.Property(e => e.IdServices) + .ValueGeneratedNever() + .HasColumnName("id_services"); + entity.Property(e => e.CodeServices) + .HasColumnType("character varying") + .HasColumnName("code_services"); + entity.Property(e => e.CostPerHour).HasColumnName("cost_per_hour"); + entity.Property(e => e.NameServices) + .HasColumnType("character varying") + .HasColumnName("name_services"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdStaff).HasName("staff_pk"); + + entity.ToTable("staff", "blagodat"); + + entity.Property(e => e.IdStaff) + .HasColumnType("character varying") + .HasColumnName("id_staff"); + entity.Property(e => e.Fio) + .HasColumnType("character varying") + .HasColumnName("fio"); + entity.Property(e => e.LastLoginDate).HasColumnName("last_login_date"); + entity.Property(e => e.LastLoginTime).HasColumnName("last_login_time"); + entity.Property(e => e.Login) + .HasColumnType("character varying") + .HasColumnName("login"); + entity.Property(e => e.Password).HasColumnType("character varying"); + entity.Property(e => e.Post) + .HasColumnType("character varying") + .HasColumnName("post"); + entity.Property(e => e.TypeOfEntrance).HasColumnName("type_of_entrance"); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +} diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..79bc1f3 --- /dev/null +++ b/Program.cs @@ -0,0 +1,21 @@ +using Avalonia; +using System; + +namespace Blagodat; + +class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); +} diff --git a/Registration.axaml b/Registration.axaml new file mode 100644 index 0000000..2d34b02 --- /dev/null +++ b/Registration.axaml @@ -0,0 +1,18 @@ + + + + + + + +