This commit is contained in:
-SSS- 2025-03-25 21:36:42 +03:00
parent 91a562a74d
commit 043cb21df9
181 changed files with 1153 additions and 608 deletions

View File

@ -4,24 +4,38 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demofinish.MainWindow"
x:CompileBindings="False"
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>
<DockPanel>
<StackPanel DockPanel.Dock="Top" Margin="10" HorizontalAlignment="Center" Orientation="Horizontal">
<AutoCompleteBox x:Name="SearchBox" Watermark="Поиск" FilterMode="StartsWith" HorizontalAlignment="Center" Margin="5" Width="200"/>
<ComboBox x:Name="PriorityCombobox" Margin="5" Width="200"/>
<ComboBox MaxDropDownHeight="100" Width="200" Margin="5">
<ComboBoxItem>Наименование</ComboBoxItem>
<ComboBoxItem>Размер скидки</ComboBoxItem>
<ComboBoxItem>Приоритет</ComboBoxItem>
</ComboBox>
</StackPanel>
<ListBox x:Name="AgentListBox">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="3"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1" Margin="5">
<StackPanel HorizontalAlignment="Center" Spacing="5">
<Image HorizontalAlignment="Center" Width="100" Height="100" Source="{Binding Logo}" Margin="5"/>
<TextBlock Text="{Binding Title}"/>
<TextBlock Text="{Binding Phone}"/>
<TextBlock Text="{Binding Priority}"/>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</Window>

View File

@ -1,20 +1,61 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Media.Imaging;
using demofinish.Models;
namespace demofinish
{
public partial class MainWindow : Window
{
private ObservableCollection<Agent> agents = new ObservableCollection<Agent>();
private List<Agent> agentsList = new List<Agent>();
public MainWindow()
{
InitializeComponent();
LoadAgents();
}
private void Guest_OnClick(object sender, RoutedEventArgs e)
private Bitmap? GetImage(string logo)
{
Product product = new Product();
product.Show(this);
this.Close();
try
{
string absolutePath = Path.Combine(AppContext.BaseDirectory, logo);
return new Bitmap(absolutePath);
}
catch (Exception ex)
{
Console.WriteLine($"Ошибка загрузки изображения: {ex.Message}");
return null;
}
}
private void LoadAgents()
{
using var context = new User1Context();
agentsList = context.Agents.ToList();
foreach (var agent in agentsList)
{
agent.Image = GetImage(agent.Logo);
}
agents.Clear();
foreach (var agent in agentsList)
{
agents.Add(agent);
}
AgentListBox.ItemsSource = agents;
}
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Avalonia.Media.Imaging;
namespace demofinish.Models;
public partial class Agent
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public int Agenttypeid { get; set; }
public string? Address { get; set; }
public string Inn { get; set; } = null!;
public string? Kpp { get; set; }
public string? Directorname { get; set; }
public string Phone { get; set; } = null!;
public string? Email { get; set; }
public string? Logo { get; set; }
public int Priority { get; set; }
public virtual ICollection<Agentpriorityhistory> Agentpriorityhistories { get; set; } = new List<Agentpriorityhistory>();
public virtual Agenttype Agenttype { get; set; } = null!;
public virtual ICollection<Productsale> Productsales { get; set; } = new List<Productsale>();
public virtual ICollection<Shop> Shops { get; set; } = new List<Shop>();
[NotMapped]
public Bitmap? Image { get; set; }
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Agentpriorityhistory
{
public int Id { get; set; }
public int Agentid { get; set; }
public DateTime Changedate { get; set; }
public int Priorityvalue { get; set; }
public virtual Agent Agent { get; set; } = null!;
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Agenttype
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public string? Image { get; set; }
public virtual ICollection<Agent> Agents { get; set; } = new List<Agent>();
}

View File

@ -1,178 +0,0 @@
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,35 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Material
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public int Countinpack { get; set; }
public string Unit { get; set; } = null!;
public decimal? Countinstock { get; set; }
public decimal Mincount { get; set; }
public string? Description { get; set; }
public decimal Cost { get; set; }
public string? Image { get; set; }
public int Materialtypeid { get; set; }
public virtual ICollection<Materialcounthistory> Materialcounthistories { get; set; } = new List<Materialcounthistory>();
public virtual Materialtype Materialtype { get; set; } = null!;
public virtual ICollection<Productmaterial> Productmaterials { get; set; } = new List<Productmaterial>();
public virtual ICollection<Supplier> Suppliers { get; set; } = new List<Supplier>();
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Materialcounthistory
{
public int Id { get; set; }
public int Materialid { get; set; }
public DateTime Changedate { get; set; }
public decimal Countvalue { get; set; }
public virtual Material Material { get; set; } = null!;
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Materialtype
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public decimal Defectedpercent { get; set; }
public virtual ICollection<Material> Materials { get; set; } = new List<Material>();
}

View File

@ -1,17 +0,0 @@
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

@ -1,17 +0,0 @@
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

@ -1,11 +0,0 @@
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

@ -5,27 +5,21 @@ namespace demofinish.Models;
public partial class Product
{
public string Productarticlenumber { get; set; } = null!;
public int Id { get; set; }
public string Productname { get; set; } = null!;
public string Title { get; set; } = null!;
public string Productdescription { get; set; } = null!;
public int? Producttypeid { get; set; }
public string Productcategory { get; set; } = null!;
public string Articlenumber { get; set; } = null!;
public string? Productphoto { get; set; }
public string? Description { get; set; }
public string Productmanufacturer { get; set; } = null!;
public string? Image { get; set; }
public decimal Productcost { get; set; }
public int? Productionpersoncount { get; set; }
public short? Productdiscountamount { get; set; }
public decimal Mincostforagent { 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>();
public int? Productionworksshopnumber { get; set; }
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class ProductType
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public double? DefectedPercent { get; set; }
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Productcosthistory
{
public int Id { get; set; }
public int Productid { get; set; }
public DateTime Changedate { get; set; }
public decimal Costvalue { get; set; }
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Productmaterial
{
public int Productid { get; set; }
public int Materialid { get; set; }
public decimal? Count { get; set; }
public virtual Material Material { get; set; } = null!;
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Productsale
{
public int Id { get; set; }
public int Agentid { get; set; }
public int Productid { get; set; }
public DateOnly Saledate { get; set; }
public int Productcount { get; set; }
public virtual Agent Agent { get; set; } = null!;
}

View File

@ -1,13 +0,0 @@
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>();
}

17
demofinish/Models/Shop.cs Normal file
View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Shop
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public string? Address { get; set; }
public int Agentid { get; set; }
public virtual Agent Agent { get; set; } = null!;
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace demofinish.Models;
public partial class Supplier
{
public int Id { get; set; }
public string Title { get; set; } = null!;
public string Inn { get; set; } = null!;
public DateOnly Startdate { get; set; }
public int? Qualityrating { get; set; }
public string? Suppliertype { get; set; }
public virtual ICollection<Material> Materials { get; set; } = new List<Material>();
}

View File

@ -1,23 +0,0 @@
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!;
}

View File

@ -0,0 +1,358 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace demofinish.Models;
public partial class User1Context : DbContext
{
public User1Context()
{
}
public User1Context(DbContextOptions<User1Context> options)
: base(options)
{
}
public virtual DbSet<Agent> Agents { get; set; }
public virtual DbSet<Agentpriorityhistory> Agentpriorityhistories { get; set; }
public virtual DbSet<Agenttype> Agenttypes { get; set; }
public virtual DbSet<Material> Materials { get; set; }
public virtual DbSet<Materialcounthistory> Materialcounthistories { get; set; }
public virtual DbSet<Materialtype> Materialtypes { get; set; }
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<ProductType> ProductTypes { get; set; }
public virtual DbSet<Productcosthistory> Productcosthistories { get; set; }
public virtual DbSet<Productmaterial> Productmaterials { get; set; }
public virtual DbSet<Productsale> Productsales { get; set; }
public virtual DbSet<Shop> Shops { get; set; }
public virtual DbSet<Supplier> Suppliers { 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;USERNAME=user1;DATABASE=user1;Password=Xgny6RrJ");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Agent>(entity =>
{
entity.HasKey(e => e.Id).HasName("agent_pkey");
entity.ToTable("agent", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Address)
.HasMaxLength(300)
.HasColumnName("address");
entity.Property(e => e.Agenttypeid).HasColumnName("agenttypeid");
entity.Property(e => e.Directorname)
.HasMaxLength(100)
.HasColumnName("directorname");
entity.Property(e => e.Email)
.HasMaxLength(255)
.HasColumnName("email");
entity.Property(e => e.Inn)
.HasMaxLength(12)
.HasColumnName("inn");
entity.Property(e => e.Kpp)
.HasMaxLength(9)
.HasColumnName("kpp");
entity.Property(e => e.Logo)
.HasMaxLength(100)
.HasColumnName("logo");
entity.Property(e => e.Phone)
.HasMaxLength(20)
.HasColumnName("phone");
entity.Property(e => e.Priority).HasColumnName("priority");
entity.Property(e => e.Title)
.HasMaxLength(150)
.HasColumnName("title");
entity.HasOne(d => d.Agenttype).WithMany(p => p.Agents)
.HasForeignKey(d => d.Agenttypeid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_agent_agenttype");
});
modelBuilder.Entity<Agentpriorityhistory>(entity =>
{
entity.HasKey(e => e.Id).HasName("agentpriorityhistory_pkey");
entity.ToTable("agentpriorityhistory", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Agentid).HasColumnName("agentid");
entity.Property(e => e.Changedate)
.HasColumnType("timestamp without time zone")
.HasColumnName("changedate");
entity.Property(e => e.Priorityvalue).HasColumnName("priorityvalue");
entity.HasOne(d => d.Agent).WithMany(p => p.Agentpriorityhistories)
.HasForeignKey(d => d.Agentid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_agentpriorityhistory_agent");
});
modelBuilder.Entity<Agenttype>(entity =>
{
entity.HasKey(e => e.Id).HasName("agenttype_pkey");
entity.ToTable("agenttype", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Image)
.HasMaxLength(100)
.HasColumnName("image");
entity.Property(e => e.Title)
.HasMaxLength(50)
.HasColumnName("title");
});
modelBuilder.Entity<Material>(entity =>
{
entity.HasKey(e => e.Id).HasName("material_pkey");
entity.ToTable("material", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Cost)
.HasPrecision(10, 2)
.HasColumnName("cost");
entity.Property(e => e.Countinpack).HasColumnName("countinpack");
entity.Property(e => e.Countinstock).HasColumnName("countinstock");
entity.Property(e => e.Description).HasColumnName("description");
entity.Property(e => e.Image)
.HasMaxLength(100)
.HasColumnName("image");
entity.Property(e => e.Materialtypeid).HasColumnName("materialtypeid");
entity.Property(e => e.Mincount).HasColumnName("mincount");
entity.Property(e => e.Title)
.HasMaxLength(100)
.HasColumnName("title");
entity.Property(e => e.Unit)
.HasMaxLength(10)
.HasColumnName("unit");
entity.HasOne(d => d.Materialtype).WithMany(p => p.Materials)
.HasForeignKey(d => d.Materialtypeid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_material_materialtype");
entity.HasMany(d => d.Suppliers).WithMany(p => p.Materials)
.UsingEntity<Dictionary<string, object>>(
"Materialsupplier",
r => r.HasOne<Supplier>().WithMany()
.HasForeignKey("Supplierid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_materialsupplier_supplier"),
l => l.HasOne<Material>().WithMany()
.HasForeignKey("Materialid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_materialsupplier_material"),
j =>
{
j.HasKey("Materialid", "Supplierid").HasName("materialsupplier_pkey");
j.ToTable("materialsupplier", "public2");
j.IndexerProperty<int>("Materialid").HasColumnName("materialid");
j.IndexerProperty<int>("Supplierid").HasColumnName("supplierid");
});
});
modelBuilder.Entity<Materialcounthistory>(entity =>
{
entity.HasKey(e => e.Id).HasName("materialcounthistory_pkey");
entity.ToTable("materialcounthistory", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Changedate)
.HasColumnType("timestamp without time zone")
.HasColumnName("changedate");
entity.Property(e => e.Countvalue).HasColumnName("countvalue");
entity.Property(e => e.Materialid).HasColumnName("materialid");
entity.HasOne(d => d.Material).WithMany(p => p.Materialcounthistories)
.HasForeignKey(d => d.Materialid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_materialcounthistory_material");
});
modelBuilder.Entity<Materialtype>(entity =>
{
entity.HasKey(e => e.Id).HasName("materialtype_pkey");
entity.ToTable("materialtype", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Defectedpercent).HasColumnName("defectedpercent");
entity.Property(e => e.Title)
.HasMaxLength(50)
.HasColumnName("title");
});
modelBuilder.Entity<Product>(entity =>
{
entity.HasKey(e => e.Id).HasName("product_pkey");
entity.ToTable("product", "public2");
entity.Property(e => e.Id)
.ValueGeneratedNever()
.HasColumnName("id");
entity.Property(e => e.Articlenumber)
.HasMaxLength(10)
.HasColumnName("articlenumber");
entity.Property(e => e.Description).HasColumnName("description");
entity.Property(e => e.Image)
.HasMaxLength(100)
.HasColumnName("image");
entity.Property(e => e.Mincostforagent)
.HasPrecision(10, 2)
.HasColumnName("mincostforagent");
entity.Property(e => e.Productionpersoncount).HasColumnName("productionpersoncount");
entity.Property(e => e.Productionworksshopnumber).HasColumnName("productionworksshopnumber");
entity.Property(e => e.Producttypeid).HasColumnName("producttypeid");
entity.Property(e => e.Title)
.HasMaxLength(100)
.HasColumnName("title");
});
modelBuilder.Entity<ProductType>(entity =>
{
entity.HasKey(e => e.Id).HasName("ProductType_pkey");
entity.ToTable("ProductType", "public2");
entity.Property(e => e.Id).HasColumnName("ID");
entity.Property(e => e.Title).HasMaxLength(50);
});
modelBuilder.Entity<Productcosthistory>(entity =>
{
entity.HasKey(e => e.Id).HasName("productcosthistory_pkey");
entity.ToTable("productcosthistory", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Changedate)
.HasColumnType("timestamp without time zone")
.HasColumnName("changedate");
entity.Property(e => e.Costvalue)
.HasPrecision(10, 2)
.HasColumnName("costvalue");
entity.Property(e => e.Productid).HasColumnName("productid");
});
modelBuilder.Entity<Productmaterial>(entity =>
{
entity.HasKey(e => new { e.Productid, e.Materialid }).HasName("productmaterial_pkey");
entity.ToTable("productmaterial", "public2");
entity.Property(e => e.Productid).HasColumnName("productid");
entity.Property(e => e.Materialid).HasColumnName("materialid");
entity.Property(e => e.Count).HasColumnName("count");
entity.HasOne(d => d.Material).WithMany(p => p.Productmaterials)
.HasForeignKey(d => d.Materialid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_productmaterial_material");
});
modelBuilder.Entity<Productsale>(entity =>
{
entity.HasKey(e => e.Id).HasName("productsale_pkey");
entity.ToTable("productsale", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Agentid).HasColumnName("agentid");
entity.Property(e => e.Productcount).HasColumnName("productcount");
entity.Property(e => e.Productid).HasColumnName("productid");
entity.Property(e => e.Saledate).HasColumnName("saledate");
entity.HasOne(d => d.Agent).WithMany(p => p.Productsales)
.HasForeignKey(d => d.Agentid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_productsale_agent");
});
modelBuilder.Entity<Shop>(entity =>
{
entity.HasKey(e => e.Id).HasName("shop_pkey");
entity.ToTable("shop", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Address)
.HasMaxLength(300)
.HasColumnName("address");
entity.Property(e => e.Agentid).HasColumnName("agentid");
entity.Property(e => e.Title)
.HasMaxLength(150)
.HasColumnName("title");
entity.HasOne(d => d.Agent).WithMany(p => p.Shops)
.HasForeignKey(d => d.Agentid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_shop_agent");
});
modelBuilder.Entity<Supplier>(entity =>
{
entity.HasKey(e => e.Id).HasName("supplier_pkey");
entity.ToTable("supplier", "public2");
entity.Property(e => e.Id)
.UseIdentityAlwaysColumn()
.HasColumnName("id");
entity.Property(e => e.Inn)
.HasMaxLength(12)
.HasColumnName("inn");
entity.Property(e => e.Qualityrating).HasColumnName("qualityrating");
entity.Property(e => e.Startdate).HasColumnName("startdate");
entity.Property(e => e.Suppliertype)
.HasMaxLength(20)
.HasColumnName("suppliertype");
entity.Property(e => e.Title)
.HasMaxLength(150)
.HasColumnName("title");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

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