init commit

This commit is contained in:
Anastasia 2024-12-26 16:15:57 +03:00
commit 91a562a74d
180 changed files with 6175 additions and 0 deletions

25
demofinish.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "demofinish", "demofinish\demofinish.csproj", "{D229918A-845B-4B14-A099-FF867FF661C5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D229918A-845B-4B14-A099-FF867FF661C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D229918A-845B-4B14-A099-FF867FF661C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D229918A-845B-4B14-A099-FF867FF661C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D229918A-845B-4B14-A099-FF867FF661C5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3907EC84-C053-47DE-BC8F-920904E9225A}
EndGlobalSection
EndGlobal

10
demofinish/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="demofinish.App"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>

24
demofinish/App.axaml.cs Normal file
View File

@ -0,0 +1,24 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
namespace demofinish
{
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();
}
}
}

View File

@ -0,0 +1,27 @@
<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="demofinish.MainWindow"
Title="demofinish">
<DockPanel>
<StackPanel HorizontalAlignment="Center" DockPanel.Dock="Top" Spacing="10">
<TextBlock HorizontalAlignment="Center" Margin="5">
Введите логин
</TextBlock>
<TextBox Width="200"/>
</StackPanel>
<StackPanel HorizontalAlignment="Center" DockPanel.Dock="Top" Spacing="10">
<TextBlock HorizontalAlignment="Center" Margin="5">
Введите пароль
</TextBlock>
<TextBox Width="200"/>
</StackPanel>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="10">
<Button Content="Войти как гость" Click="Guest_OnClick"/>
<Button Content="Войти"/>
</StackPanel>
</DockPanel>
</Window>

View File

@ -0,0 +1,20 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
namespace demofinish
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Guest_OnClick(object sender, RoutedEventArgs e)
{
Product product = new Product();
product.Show(this);
this.Close();
}
}
}

View File

@ -0,0 +1,178 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace demofinish.Models;
public partial class DemodbContext : DbContext
{
public DemodbContext()
{
}
public DemodbContext(DbContextOptions<DemodbContext> options)
: base(options)
{
}
public virtual DbSet<Order> Orders { get; set; }
public virtual DbSet<OrderProduct> OrderProducts { get; set; }
public virtual DbSet<Pickuppoint> Pickuppoints { get; set; }
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<Role> Roles { get; set; }
public virtual DbSet<User> Users { 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=localhost;Port=5432;Database=demodb;Username=postgres;Password=123");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Order>(entity =>
{
entity.HasKey(e => e.Orderid).HasName("Order_pkey");
entity.ToTable("Order");
entity.Property(e => e.Orderid)
.UseIdentityAlwaysColumn()
.HasColumnName("orderid");
entity.Property(e => e.Orderdeliverydate)
.HasColumnType("timestamp without time zone")
.HasColumnName("orderdeliverydate");
entity.Property(e => e.Orderpickuppoint).HasColumnName("orderpickuppoint");
entity.Property(e => e.Orderstatus)
.HasColumnType("character varying")
.HasColumnName("orderstatus");
});
modelBuilder.Entity<OrderProduct>(entity =>
{
entity.HasKey(e => new { e.Orderid, e.Productarticlenumber }).HasName("OrderProduct_pkey");
entity.ToTable("OrderProduct");
entity.Property(e => e.Orderid).HasColumnName("orderid");
entity.Property(e => e.Productarticlenumber)
.HasMaxLength(100)
.HasColumnName("productarticlenumber");
entity.Property(e => e.Count).HasColumnName("count");
entity.HasOne(d => d.Order).WithMany(p => p.OrderProducts)
.HasForeignKey(d => d.Orderid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("OrderProduct_orderid_fkey");
entity.HasOne(d => d.ProductarticlenumberNavigation).WithMany(p => p.OrderProducts)
.HasForeignKey(d => d.Productarticlenumber)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("OrderProduct_productarticlenumber_fkey");
});
modelBuilder.Entity<Pickuppoint>(entity =>
{
entity.HasKey(e => e.Pickuppointid).HasName("pickuppoint_pk");
entity.ToTable("pickuppoint");
entity.Property(e => e.Pickuppointid)
.UseIdentityAlwaysColumn()
.HasColumnName("pickuppointid");
entity.Property(e => e.Pickupname)
.HasColumnType("character varying")
.HasColumnName("pickupname");
});
modelBuilder.Entity<Product>(entity =>
{
entity.HasKey(e => e.Productarticlenumber).HasName("Product_pkey");
entity.ToTable("Product");
entity.Property(e => e.Productarticlenumber)
.HasColumnType("character varying")
.HasColumnName("productarticlenumber");
entity.Property(e => e.Discountmax)
.HasPrecision(19, 4)
.HasColumnName("discountmax");
entity.Property(e => e.Productcategory)
.HasColumnType("character varying")
.HasColumnName("productcategory");
entity.Property(e => e.Productcost)
.HasPrecision(19, 4)
.HasColumnName("productcost");
entity.Property(e => e.Productdescription)
.HasColumnType("character varying")
.HasColumnName("productdescription");
entity.Property(e => e.Productdiscountamount).HasColumnName("productdiscountamount");
entity.Property(e => e.Productmanufacturer)
.HasColumnType("character varying")
.HasColumnName("productmanufacturer");
entity.Property(e => e.Productname)
.HasColumnType("character varying")
.HasColumnName("productname");
entity.Property(e => e.Productphoto)
.HasColumnType("character varying")
.HasColumnName("productphoto");
entity.Property(e => e.Productquantityinstock).HasColumnName("productquantityinstock");
entity.Property(e => e.Productstatus)
.HasColumnType("character varying")
.HasColumnName("productstatus");
});
modelBuilder.Entity<Role>(entity =>
{
entity.HasKey(e => e.Roleid).HasName("role_pkey");
entity.ToTable("role");
entity.Property(e => e.Roleid)
.UseIdentityAlwaysColumn()
.HasColumnName("roleid");
entity.Property(e => e.Rolename)
.HasMaxLength(100)
.HasColumnName("rolename");
});
modelBuilder.Entity<User>(entity =>
{
entity.HasKey(e => e.Userid).HasName("User_pkey");
entity.ToTable("User");
entity.Property(e => e.Userid)
.UseIdentityAlwaysColumn()
.HasColumnName("userid");
entity.Property(e => e.Userlogin)
.HasColumnType("character varying")
.HasColumnName("userlogin");
entity.Property(e => e.Username)
.HasMaxLength(100)
.HasColumnName("username");
entity.Property(e => e.Userpassword)
.HasColumnType("character varying")
.HasColumnName("userpassword");
entity.Property(e => e.Userpatronymic)
.HasMaxLength(100)
.HasColumnName("userpatronymic");
entity.Property(e => e.Userrole).HasColumnName("userrole");
entity.Property(e => e.Usersurname)
.HasMaxLength(100)
.HasColumnName("usersurname");
entity.HasOne(d => d.UserroleNavigation).WithMany(p => p.Users)
.HasForeignKey(d => d.Userrole)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("User_userrole_fkey");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Order
{
public int Orderid { get; set; }
public string Orderstatus { get; set; } = null!;
public DateTime? Orderdeliverydate { get; set; }
public int Orderpickuppoint { get; set; }
public virtual ICollection<OrderProduct> OrderProducts { get; set; } = new List<OrderProduct>();
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class OrderProduct
{
public int Orderid { get; set; }
public string Productarticlenumber { get; set; } = null!;
public int Count { get; set; }
public virtual Order Order { get; set; } = null!;
public virtual Product ProductarticlenumberNavigation { get; set; } = null!;
}

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Pickuppoint
{
public int Pickuppointid { get; set; }
public string? Pickupname { get; set; }
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Product
{
public string Productarticlenumber { get; set; } = null!;
public string Productname { get; set; } = null!;
public string Productdescription { get; set; } = null!;
public string Productcategory { get; set; } = null!;
public string? Productphoto { get; set; }
public string Productmanufacturer { get; set; } = null!;
public decimal Productcost { get; set; }
public short? Productdiscountamount { get; set; }
public int Productquantityinstock { get; set; }
public string? Productstatus { get; set; }
public decimal? Discountmax { get; set; }
public virtual ICollection<OrderProduct> OrderProducts { get; set; } = new List<OrderProduct>();
}

13
demofinish/Models/Role.cs Normal file
View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Role
{
public int Roleid { get; set; }
public string Rolename { get; set; } = null!;
public virtual ICollection<User> Users { get; set; } = new List<User>();
}

23
demofinish/Models/User.cs Normal file
View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class User
{
public int Userid { get; set; }
public string Usersurname { get; set; } = null!;
public string Username { get; set; } = null!;
public string Userpatronymic { get; set; } = null!;
public string Userlogin { get; set; } = null!;
public string Userpassword { get; set; } = null!;
public int Userrole { get; set; }
public virtual Role UserroleNavigation { get; set; } = null!;
}

11
demofinish/Product.axaml Normal file
View File

@ -0,0 +1,11 @@
<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="demofinish.Product"
Title="Product">
</Window>

View File

@ -0,0 +1,17 @@
using Avalonia.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace demofinish
{
public partial class Product : Window
{
public Product()
{
InitializeComponent();
}
}
}

22
demofinish/Program.cs Normal file
View File

@ -0,0 +1,22 @@
using Avalonia;
using System;
namespace demofinish
{
internal 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
demofinish/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="demofinish.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.

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.

File diff suppressed because it is too large Load Diff

Binary file not shown.

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
}
}
}

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