first commit

This commit is contained in:
Guitaras_Fingerchpoker 2025-04-17 05:05:48 +03:00
commit 914d43e042
240 changed files with 10617 additions and 0 deletions

Binary file not shown.

Binary file not shown.

BIN
.vs/Demo1704/v17/.suo Normal file

Binary file not shown.

View File

@ -0,0 +1,94 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|c:\\users\\jauli\\desktop\\f\\demo1704\\demo1704\\demo1704.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|",
"RelativeMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|solutionrelative:demo1704\\demo1704.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|"
},
{
"AbsoluteMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|c:\\users\\jauli\\desktop\\f\\demo1704\\demo1704\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|solutionrelative:demo1704\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|c:\\users\\jauli\\desktop\\f\\demo1704\\demo1704\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|solutionrelative:demo1704\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 1,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedHeight": 200,
"SelectedChildIndex": 2,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Demo1704.csproj",
"DocumentMoniker": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\Demo1704.csproj",
"RelativeDocumentMoniker": "Demo1704\\Demo1704.csproj",
"ToolTip": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\Demo1704.csproj",
"RelativeToolTip": "Demo1704\\Demo1704.csproj",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
"WhenOpened": "2025-04-17T01:34:41.432Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "MainWindow.axaml",
"DocumentMoniker": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml",
"RelativeDocumentMoniker": "Demo1704\\MainWindow.axaml",
"ToolTip": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml",
"RelativeToolTip": "Demo1704\\MainWindow.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-04-17T01:20:17.617Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "MainWindow.axaml.cs",
"DocumentMoniker": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml.cs",
"RelativeDocumentMoniker": "Demo1704\\MainWindow.axaml.cs",
"ToolTip": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml.cs",
"RelativeToolTip": "Demo1704\\MainWindow.axaml.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-04-17T01:20:14.091Z"
}
]
},
{
"DockedHeight": 78,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:1:0:{d212f56b-c48a-434c-a121-1c5d80b59b9f}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
}
]
}
]
}
]
}

View File

@ -0,0 +1,112 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|c:\\users\\jauli\\desktop\\f\\demo1704\\demo1704\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|solutionrelative:demo1704\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|c:\\users\\jauli\\desktop\\f\\demo1704\\demo1704\\app.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|solutionrelative:demo1704\\app.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|c:\\users\\jauli\\desktop\\f\\demo1704\\demo1704\\demo1704.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|",
"RelativeMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|solutionrelative:demo1704\\demo1704.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|"
},
{
"AbsoluteMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|c:\\users\\jauli\\desktop\\f\\demo1704\\demo1704\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{978FB3AB-909E-4839-8F9B-C51896E77280}|Demo1704\\Demo1704.csproj|solutionrelative:demo1704\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 1,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedHeight": 200,
"SelectedChildIndex": 4,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "App.axaml.cs",
"DocumentMoniker": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\App.axaml.cs",
"RelativeDocumentMoniker": "Demo1704\\App.axaml.cs",
"ToolTip": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\App.axaml.cs",
"RelativeToolTip": "Demo1704\\App.axaml.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-04-17T01:44:41.382Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "Demo1704.csproj",
"DocumentMoniker": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\Demo1704.csproj",
"RelativeDocumentMoniker": "Demo1704\\Demo1704.csproj",
"ToolTip": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\Demo1704.csproj",
"RelativeToolTip": "Demo1704\\Demo1704.csproj",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
"WhenOpened": "2025-04-17T01:34:41.432Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "MainWindow.axaml",
"DocumentMoniker": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml",
"RelativeDocumentMoniker": "Demo1704\\MainWindow.axaml",
"ToolTip": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml",
"RelativeToolTip": "Demo1704\\MainWindow.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-04-17T01:20:17.617Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "MainWindow.axaml.cs",
"DocumentMoniker": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml.cs",
"RelativeDocumentMoniker": "Demo1704\\MainWindow.axaml.cs",
"ToolTip": "C:\\Users\\jauli\\Desktop\\f\\Demo1704\\Demo1704\\MainWindow.axaml.cs",
"RelativeToolTip": "Demo1704\\MainWindow.axaml.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-04-17T01:20:14.091Z"
}
]
},
{
"DockedHeight": 78,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:1:0:{d212f56b-c48a-434c-a121-1c5d80b59b9f}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
}
]
}
]
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

25
Demo1704.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.35906.104 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo1704", "Demo1704\Demo1704.csproj", "{978FB3AB-909E-4839-8F9B-C51896E77280}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{978FB3AB-909E-4839-8F9B-C51896E77280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{978FB3AB-909E-4839-8F9B-C51896E77280}.Debug|Any CPU.Build.0 = Debug|Any CPU
{978FB3AB-909E-4839-8F9B-C51896E77280}.Release|Any CPU.ActiveCfg = Release|Any CPU
{978FB3AB-909E-4839-8F9B-C51896E77280}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ADBDBD8B-CFEC-4E10-B1FB-6026EB1F2455}
EndGlobalSection
EndGlobal

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

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

@ -0,0 +1,24 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
namespace Demo1704
{
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,363 @@
using System;
using System.Collections.Generic;
using Demo1704.Models;
using Microsoft.EntityFrameworkCore;
namespace Demo1704.Context;
public partial class User19Context : DbContext
{
public User19Context()
{
}
public User19Context(DbContextOptions<User19Context> options)
: base(options)
{
}
public virtual DbSet<Client> Clients { get; set; }
public virtual DbSet<Clientservice> Clientservices { get; set; }
public virtual DbSet<Documentbyservice> Documentbyservices { get; set; }
public virtual DbSet<Gender> Genders { get; set; }
public virtual DbSet<Manufacturer> Manufacturers { get; set; }
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<Productphoto> Productphotos { get; set; }
public virtual DbSet<Productsale> Productsales { get; set; }
public virtual DbSet<Service> Services { get; set; }
public virtual DbSet<Servicephoto> Servicephotos { get; set; }
public virtual DbSet<Tag> Tags { 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;Database=user19;Username=user19;Password=oplwLVnn");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Client>(entity =>
{
entity.HasKey(e => e.Id).HasName("client_pkey");
entity.ToTable("client", "task16-09");
entity.HasIndex(e => e.Gendercode, "IX_client_gendercode");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Birthday).HasColumnName("birthday");
entity.Property(e => e.Email)
.HasMaxLength(255)
.HasColumnName("email");
entity.Property(e => e.Firstname)
.HasMaxLength(50)
.HasColumnName("firstname");
entity.Property(e => e.Gendercode)
.HasMaxLength(1)
.HasColumnName("gendercode");
entity.Property(e => e.Lastname)
.HasMaxLength(50)
.HasColumnName("lastname");
entity.Property(e => e.Patronymic)
.HasMaxLength(50)
.HasColumnName("patronymic");
entity.Property(e => e.Phone)
.HasMaxLength(20)
.HasColumnName("phone");
entity.Property(e => e.Photopath)
.HasMaxLength(1000)
.HasColumnName("photopath");
entity.Property(e => e.Registrationdate)
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("registrationdate");
entity.HasOne(d => d.GendercodeNavigation).WithMany(p => p.Clients)
.HasForeignKey(d => d.Gendercode)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_client_gender");
entity.HasMany(d => d.Tags).WithMany(p => p.Clients)
.UsingEntity<Dictionary<string, object>>(
"Tagofclient",
r => r.HasOne<Tag>().WithMany()
.HasForeignKey("Tagid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("tagofclient_tag_fk"),
l => l.HasOne<Client>().WithMany()
.HasForeignKey("Clientid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_tagofclient_client"),
j =>
{
j.HasKey("Clientid", "Tagid").HasName("tagofclient_pkey");
j.ToTable("tagofclient", "task16-09");
j.HasIndex(new[] { "Tagid" }, "IX_tagofclient_tagid");
j.IndexerProperty<int>("Clientid").HasColumnName("clientid");
j.IndexerProperty<int>("Tagid").HasColumnName("tagid");
});
});
modelBuilder.Entity<Clientservice>(entity =>
{
entity.HasKey(e => e.Id).HasName("clientservice_pkey");
entity.ToTable("clientservice", "task16-09");
entity.HasIndex(e => e.Clientid, "IX_clientservice_clientid");
entity.HasIndex(e => e.Serviceid, "IX_clientservice_serviceid");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Clientid).HasColumnName("clientid");
entity.Property(e => e.Comment).HasColumnName("comment");
entity.Property(e => e.Serviceid).HasColumnName("serviceid");
entity.Property(e => e.Starttime)
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("starttime");
entity.HasOne(d => d.Client).WithMany(p => p.Clientservices)
.HasForeignKey(d => d.Clientid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_clientservice_client");
entity.HasOne(d => d.Service).WithMany(p => p.Clientservices)
.HasForeignKey(d => d.Serviceid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("clientservice_service_fk");
});
modelBuilder.Entity<Documentbyservice>(entity =>
{
entity.HasKey(e => e.Id).HasName("documentbyservice_pkey");
entity.ToTable("documentbyservice", "task16-09");
entity.HasIndex(e => e.Clientserviceid, "IX_documentbyservice_clientserviceid");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Clientserviceid).HasColumnName("clientserviceid");
entity.Property(e => e.Documentpath)
.HasMaxLength(1000)
.HasColumnName("documentpath");
entity.HasOne(d => d.Clientservice).WithMany(p => p.Documentbyservices)
.HasForeignKey(d => d.Clientserviceid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_documentbyservice_clientservice");
});
modelBuilder.Entity<Gender>(entity =>
{
entity.HasKey(e => e.Code).HasName("gender_pkey");
entity.ToTable("gender", "task16-09");
entity.Property(e => e.Code)
.HasMaxLength(1)
.ValueGeneratedNever()
.HasColumnName("code");
entity.Property(e => e.Name)
.HasMaxLength(10)
.HasColumnName("name");
});
modelBuilder.Entity<Manufacturer>(entity =>
{
entity.HasKey(e => e.Id).HasName("manufacturer_pkey");
entity.ToTable("manufacturer", "task16-09");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Name)
.HasMaxLength(100)
.HasColumnName("name");
entity.Property(e => e.Startdate).HasColumnName("startdate");
});
modelBuilder.Entity<Product>(entity =>
{
entity.HasKey(e => e.Id).HasName("product_pkey");
entity.ToTable("product", "task16-09");
entity.HasIndex(e => e.Manufacturerid, "IX_product_manufacturerid");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Cost)
.HasPrecision(19, 4)
.HasColumnName("cost");
entity.Property(e => e.Description).HasColumnName("description");
entity.Property(e => e.Isactive).HasColumnName("isactive");
entity.Property(e => e.Mainimagepath)
.HasMaxLength(1000)
.HasColumnName("mainimagepath");
entity.Property(e => e.Manufacturerid).HasColumnName("manufacturerid");
entity.Property(e => e.Title)
.HasMaxLength(100)
.HasColumnName("title");
entity.HasOne(d => d.Manufacturer).WithMany(p => p.Products)
.HasForeignKey(d => d.Manufacturerid)
.HasConstraintName("fk_product_manufacturer");
entity.HasMany(d => d.Attachedproducts).WithMany(p => p.Mainproducts)
.UsingEntity<Dictionary<string, object>>(
"Attachedproduct",
r => r.HasOne<Product>().WithMany()
.HasForeignKey("Attachedproductid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_attachedproduct_product1"),
l => l.HasOne<Product>().WithMany()
.HasForeignKey("Mainproductid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_attachedproduct_product"),
j =>
{
j.HasKey("Mainproductid", "Attachedproductid").HasName("attachedproduct_pkey");
j.ToTable("attachedproduct", "task16-09");
j.HasIndex(new[] { "Attachedproductid" }, "IX_attachedproduct_attachedproductid");
j.IndexerProperty<int>("Mainproductid").HasColumnName("mainproductid");
j.IndexerProperty<int>("Attachedproductid").HasColumnName("attachedproductid");
});
entity.HasMany(d => d.Mainproducts).WithMany(p => p.Attachedproducts)
.UsingEntity<Dictionary<string, object>>(
"Attachedproduct",
r => r.HasOne<Product>().WithMany()
.HasForeignKey("Mainproductid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_attachedproduct_product"),
l => l.HasOne<Product>().WithMany()
.HasForeignKey("Attachedproductid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_attachedproduct_product1"),
j =>
{
j.HasKey("Mainproductid", "Attachedproductid").HasName("attachedproduct_pkey");
j.ToTable("attachedproduct", "task16-09");
j.HasIndex(new[] { "Attachedproductid" }, "IX_attachedproduct_attachedproductid");
j.IndexerProperty<int>("Mainproductid").HasColumnName("mainproductid");
j.IndexerProperty<int>("Attachedproductid").HasColumnName("attachedproductid");
});
});
modelBuilder.Entity<Productphoto>(entity =>
{
entity.HasKey(e => e.Id).HasName("productphoto_pkey");
entity.ToTable("productphoto", "task16-09");
entity.HasIndex(e => e.Productid, "IX_productphoto_productid");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Photopath)
.HasMaxLength(1000)
.HasColumnName("photopath");
entity.Property(e => e.Productid).HasColumnName("productid");
entity.HasOne(d => d.Product).WithMany(p => p.Productphotos)
.HasForeignKey(d => d.Productid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_productphoto_product");
});
modelBuilder.Entity<Productsale>(entity =>
{
entity.HasKey(e => e.Id).HasName("productsale_pkey");
entity.ToTable("productsale", "task16-09");
entity.HasIndex(e => e.Clientserviceid, "IX_productsale_clientserviceid");
entity.HasIndex(e => e.Productid, "IX_productsale_productid");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Clientserviceid).HasColumnName("clientserviceid");
entity.Property(e => e.Productid).HasColumnName("productid");
entity.Property(e => e.Quantity).HasColumnName("quantity");
entity.Property(e => e.Saledate)
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("saledate");
entity.HasOne(d => d.Clientservice).WithMany(p => p.Productsales)
.HasForeignKey(d => d.Clientserviceid)
.HasConstraintName("fk_productsale_clientservice");
entity.HasOne(d => d.Product).WithMany(p => p.Productsales)
.HasForeignKey(d => d.Productid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_productsale_product");
});
modelBuilder.Entity<Service>(entity =>
{
entity.HasKey(e => e.Id).HasName("service_pkey");
entity.ToTable("service", "task16-09");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Cost)
.HasPrecision(19, 4)
.HasColumnName("cost");
entity.Property(e => e.Description).HasColumnName("description");
entity.Property(e => e.Discount).HasColumnName("discount");
entity.Property(e => e.Durationinseconds).HasColumnName("durationinseconds");
entity.Property(e => e.Mainimagepath)
.HasMaxLength(1000)
.HasColumnName("mainimagepath");
entity.Property(e => e.Title)
.HasMaxLength(100)
.HasColumnName("title");
});
modelBuilder.Entity<Servicephoto>(entity =>
{
entity.HasKey(e => e.Id).HasName("servicephoto_pkey");
entity.ToTable("servicephoto", "task16-09");
entity.HasIndex(e => e.Serviceid, "IX_servicephoto_serviceid");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Photopath)
.HasMaxLength(1000)
.HasColumnName("photopath");
entity.Property(e => e.Serviceid).HasColumnName("serviceid");
entity.HasOne(d => d.Service).WithMany(p => p.Servicephotos)
.HasForeignKey(d => d.Serviceid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_servicephoto_service");
});
modelBuilder.Entity<Tag>(entity =>
{
entity.HasKey(e => e.Id).HasName("tag_pkey");
entity.ToTable("tag", "task16-09");
entity.Property(e => e.Id)
.ValueGeneratedNever()
.HasColumnName("id");
entity.Property(e => e.Color)
.HasMaxLength(8)
.IsFixedLength()
.HasColumnName("color");
entity.Property(e => e.Title)
.HasMaxLength(30)
.HasColumnName("title");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

25
Demo1704/Demo1704.csproj Normal file
View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.10" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,9 @@
<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="Demo1704.MainWindow"
Title="Demo1704">
</Window>

View File

@ -0,0 +1,12 @@
using Avalonia.Controls;
namespace Demo1704
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

33
Demo1704/Models/Client.cs Normal file
View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Client
{
public int Id { get; set; }
public string Firstname { get; set; } = null!;
public string Lastname { get; set; } = null!;
public string? Patronymic { get; set; }
public DateOnly? Birthday { get; set; }
public DateTime Registrationdate { get; set; }
public string? Email { get; set; }
public string Phone { get; set; } = null!;
public char Gendercode { get; set; }
public string? Photopath { get; set; }
public virtual ICollection<Clientservice> Clientservices { get; set; } = new List<Clientservice>();
public virtual Gender GendercodeNavigation { get; set; } = null!;
public virtual ICollection<Tag> Tags { get; set; } = new List<Tag>();
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Clientservice
{
public int Id { get; set; }
public int Clientid { get; set; }
public int Serviceid { get; set; }
public DateTime Starttime { get; set; }
public string? Comment { get; set; }
public virtual Client Client { get; set; } = null!;
public virtual ICollection<Documentbyservice> Documentbyservices { get; set; } = new List<Documentbyservice>();
public virtual ICollection<Productsale> Productsales { get; set; } = new List<Productsale>();
public virtual Service Service { get; set; } = null!;
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Documentbyservice
{
public int Id { get; set; }
public int Clientserviceid { get; set; }
public string Documentpath { get; set; } = null!;
public virtual Clientservice Clientservice { get; set; } = null!;
}

13
Demo1704/Models/Gender.cs Normal file
View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Gender
{
public char Code { get; set; }
public string? Name { get; set; }
public virtual ICollection<Client> Clients { get; set; } = new List<Client>();
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Manufacturer
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public DateOnly? Startdate { get; set; }
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Product
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public decimal Cost { get; set; }
public string? Description { get; set; }
public string? Mainimagepath { get; set; }
public int Isactive { get; set; }
public int? Manufacturerid { get; set; }
public virtual Manufacturer? Manufacturer { get; set; }
public virtual ICollection<Productphoto> Productphotos { get; set; } = new List<Productphoto>();
public virtual ICollection<Productsale> Productsales { get; set; } = new List<Productsale>();
public virtual ICollection<Product> Attachedproducts { get; set; } = new List<Product>();
public virtual ICollection<Product> Mainproducts { get; set; } = new List<Product>();
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Productphoto
{
public int Id { get; set; }
public int Productid { get; set; }
public string Photopath { get; set; } = null!;
public virtual Product Product { get; set; } = null!;
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Productsale
{
public int Id { get; set; }
public DateTime Saledate { get; set; }
public int Productid { get; set; }
public int Quantity { get; set; }
public int? Clientserviceid { get; set; }
public virtual Clientservice? Clientservice { get; set; }
public virtual Product Product { get; set; } = null!;
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Service
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public decimal Cost { get; set; }
public int Durationinseconds { get; set; }
public string? Description { get; set; }
public double? Discount { get; set; }
public string? Mainimagepath { get; set; }
public virtual ICollection<Clientservice> Clientservices { get; set; } = new List<Clientservice>();
public virtual ICollection<Servicephoto> Servicephotos { get; set; } = new List<Servicephoto>();
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Servicephoto
{
public int Id { get; set; }
public int Serviceid { get; set; }
public string Photopath { get; set; } = null!;
public virtual Service Service { get; set; } = null!;
}

15
Demo1704/Models/Tag.cs Normal file
View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Demo1704.Models;
public partial class Tag
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public string Color { get; set; } = null!;
public virtual ICollection<Client> Clients { get; set; } = new List<Client>();
}

22
Demo1704/Program.cs Normal file
View File

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

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

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.

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