init commit

This commit is contained in:
End3r 2025-02-04 15:27:32 +03:00
commit e8319cee61
180 changed files with 5982 additions and 0 deletions

10
App.axaml Normal file
View File

@ -0,0 +1,10 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="demo_hard.App"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>

23
App.axaml.cs Normal file
View File

@ -0,0 +1,23 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
namespace demo_hard;
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
}
base.OnFrameworkInitializationCompleted();
}
}

26
FunctionWindow.axaml Normal file
View File

@ -0,0 +1,26 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demo_hard.FunctionWindow"
x:CompileBindings="False"
Title="FunctionWindow">
<DockPanel>
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Orientation="Horizontal" >
<StackPanel>
<Image></Image>
</StackPanel>
<StackPanel>
<TextBlock>
<Run Text="ФИО:"/>
<Run Text="{}"/>
</TextBlock>
<TextBlock>
<Run Text="Роль"/>
<Run Text="{}"/>
</TextBlock>
</StackPanel>
</StackPanel>
</DockPanel>
</Window>

15
FunctionWindow.axaml.cs Normal file
View File

@ -0,0 +1,15 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using demo_hard.Models;
namespace demo_hard;
public partial class FunctionWindow : Window
{
public FunctionWindow()
{
InitializeComponent();
DataContext = new Employee();
}
}

22
MainWindow.axaml Normal file
View File

@ -0,0 +1,22 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demo_hard.MainWindow"
Title="demo_hard">
<DockPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" DockPanel.Dock="Top">
<TextBlock Text="Точки проката горнолыжного комплекса «Благодать»"/>
</StackPanel>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="5">
<TextBlock Text="Введите логин" HorizontalAlignment="Center" Margin="5"/>
<TextBox x:Name="LoginBox" Margin="5" Width="200"/>
<TextBlock Text="Введите пароль" HorizontalAlignment="Center" Margin="5"/>
<TextBox x:Name="PasswordBox" Margin="5" Width="200" PasswordChar="*"/>
<Button x:Name="ForPassword" Content="Показать пароль" Margin="5" Click="TogglePasswordVisibility" HorizontalAlignment="Center"/>
<Button x:Name="Authorize" Content="Авторизироваться" Margin="5" Click="AuthorizeButton" HorizontalAlignment="Center"/>
</StackPanel>
</DockPanel>
</Window>

22
MainWindow.axaml.cs Normal file
View File

@ -0,0 +1,22 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
namespace demo_hard;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void TogglePasswordVisibility(object? sender, RoutedEventArgs e)
{
PasswordBox.PasswordChar = PasswordBox.PasswordChar == '*' ? '\0' : '*';
}
private void AuthorizeButton(object? sender, RoutedEventArgs e)
{
new FunctionWindow().ShowDialog(this);
}
}

25
Models/Client.cs Normal file
View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace demo_hard.Models;
public partial class Client
{
public int Id { get; set; }
public string Fio { get; set; } = null!;
public int CodeClient { get; set; }
public string Passport { get; set; } = null!;
public DateOnly Birthday { get; set; }
public string Address { get; set; } = null!;
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
public int? RoleId { get; set; }
}

25
Models/Employee.cs Normal file
View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace demo_hard.Models;
public partial class Employee
{
public int Id { get; set; }
public int EmployeeId { get; set; }
public string Role { get; set; } = null!;
public string Fio { get; set; } = null!;
public string Login { get; set; } = null!;
public string Password { get; set; } = null!;
public DateTime? LastEnter { get; set; }
public string? TypeEnter { get; set; }
public string? Photo { get; set; }
}

25
Models/Order.cs Normal file
View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace demo_hard.Models;
public partial class Order
{
public int OrderId { get; set; }
public string? OrderCode { get; set; }
public DateOnly? Date { get; set; }
public TimeOnly? Time { get; set; }
public int? CodeClient { get; set; }
public string? ServiceId { get; set; }
public string? Status { get; set; }
public DateOnly? DateClose { get; set; }
public int? RentalTime { get; set; }
}

11
Models/Role.cs Normal file
View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace demo_hard.Models;
public partial class Role
{
public int RoleId { get; set; }
public string RoleName { get; set; } = null!;
}

17
Models/Service.cs Normal file
View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace demo_hard.Models;
public partial class Service
{
public int Id { get; set; }
public int ServiceId { get; set; }
public string ServiceName { get; set; } = null!;
public string ServiceCode { get; set; } = null!;
public int ServiceCost { get; set; }
}

160
Models/User2Context.cs Normal file
View File

@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace demo_hard.Models;
public partial class User2Context : DbContext
{
public User2Context()
{
}
public User2Context(DbContextOptions<User2Context> options)
: base(options)
{
}
public virtual DbSet<Client> Clients { get; set; }
public virtual DbSet<Employee> Employees { get; set; }
public virtual DbSet<Order> Orders { get; set; }
public virtual DbSet<Role> Roles { get; set; }
public virtual DbSet<Service> Services { 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=5454;USERNAME=user2;DATABASE=user2;Password=hGcLvi0i");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Client>(entity =>
{
entity.HasKey(e => e.Id).HasName("clients_pk");
entity.ToTable("clients");
entity.HasIndex(e => e.CodeClient, "clients_unique").IsUnique();
entity.HasIndex(e => e.Passport, "clients_unique_1").IsUnique();
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Address)
.HasColumnType("character varying")
.HasColumnName("address");
entity.Property(e => e.Birthday).HasColumnName("birthday");
entity.Property(e => e.CodeClient).HasColumnName("code_client");
entity.Property(e => e.Email)
.HasColumnType("character varying")
.HasColumnName("email");
entity.Property(e => e.Fio)
.HasColumnType("character varying")
.HasColumnName("fio");
entity.Property(e => e.Passport)
.HasColumnType("character varying")
.HasColumnName("passport");
entity.Property(e => e.Password)
.HasColumnType("character varying")
.HasColumnName("password");
entity.Property(e => e.RoleId).HasColumnName("role_id");
});
modelBuilder.Entity<Employee>(entity =>
{
entity.HasKey(e => e.Id).HasName("employees_pk");
entity.ToTable("employees");
entity.HasIndex(e => e.EmployeeId, "employees_unique").IsUnique();
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.EmployeeId).HasColumnName("employee_id");
entity.Property(e => e.Fio)
.HasColumnType("character varying")
.HasColumnName("fio");
entity.Property(e => e.LastEnter)
.HasColumnType("timestamp without time zone")
.HasColumnName("last_enter");
entity.Property(e => e.Login)
.HasColumnType("character varying")
.HasColumnName("login");
entity.Property(e => e.Password)
.HasColumnType("character varying")
.HasColumnName("password");
entity.Property(e => e.Photo)
.HasColumnType("character varying")
.HasColumnName("photo");
entity.Property(e => e.Role)
.HasColumnType("character varying")
.HasColumnName("role");
entity.Property(e => e.TypeEnter)
.HasColumnType("character varying")
.HasColumnName("type_enter");
});
modelBuilder.Entity<Order>(entity =>
{
entity.HasKey(e => e.OrderId).HasName("orders_pk");
entity.ToTable("orders");
entity.Property(e => e.OrderId)
.UseIdentityAlwaysColumn()
.HasColumnName("order_id");
entity.Property(e => e.CodeClient).HasColumnName("code_client");
entity.Property(e => e.Date).HasColumnName("date");
entity.Property(e => e.DateClose).HasColumnName("date_close");
entity.Property(e => e.OrderCode)
.HasColumnType("character varying")
.HasColumnName("order_code");
entity.Property(e => e.RentalTime).HasColumnName("rental_time");
entity.Property(e => e.ServiceId)
.HasColumnType("character varying")
.HasColumnName("service_id");
entity.Property(e => e.Status)
.HasColumnType("character varying")
.HasColumnName("status");
entity.Property(e => e.Time).HasColumnName("time");
});
modelBuilder.Entity<Role>(entity =>
{
entity.HasKey(e => e.RoleId).HasName("roles_pk");
entity.ToTable("roles");
entity.Property(e => e.RoleId).HasColumnName("role_id");
entity.Property(e => e.RoleName)
.HasColumnType("character varying")
.HasColumnName("role_name");
});
modelBuilder.Entity<Service>(entity =>
{
entity.HasKey(e => e.Id).HasName("services_pk");
entity.ToTable("services");
entity.HasIndex(e => e.ServiceId, "services_unique").IsUnique();
entity.HasIndex(e => e.ServiceCode, "services_unique_1").IsUnique();
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.ServiceCode)
.HasColumnType("character varying")
.HasColumnName("service_code");
entity.Property(e => e.ServiceCost).HasColumnName("service_cost");
entity.Property(e => e.ServiceId).HasColumnName("service_id");
entity.Property(e => e.ServiceName)
.HasColumnType("character varying")
.HasColumnName("service_name");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

21
Program.cs Normal file
View File

@ -0,0 +1,21 @@
using Avalonia;
using System;
namespace demo_hard;
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<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}

18
app.manifest Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- This manifest is used on Windows only.
Don't remove it as it might cause problems with window transparency and embedded controls.
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<assemblyIdentity version="1.0.0.0" name="demo_hard.Desktop"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/Debug/net8.0/Avalonia.X11.dll Executable file

Binary file not shown.

BIN
bin/Debug/net8.0/Avalonia.dll Executable file

Binary file not shown.

Binary file not shown.

BIN
bin/Debug/net8.0/Humanizer.dll Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/Debug/net8.0/Npgsql.dll Executable file

Binary file not shown.

BIN
bin/Debug/net8.0/SkiaSharp.dll Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/Debug/net8.0/demo_hard Executable file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.InteropServices.BuiltInComInterop.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More