diff --git a/WinFormsProject/AppView/FormMain.resx b/WinFormsProject/AppView/FormMain.resx index afd9012..eb5684b 100644 --- a/WinFormsProject/AppView/FormMain.resx +++ b/WinFormsProject/AppView/FormMain.resx @@ -1,64 +1,4 @@ - - - + diff --git a/WinFormsProject/DateBaseImplement/DBContext.cs b/WinFormsProject/DateBaseImplement/DBContext.cs index f3d8c73..2898f33 100644 --- a/WinFormsProject/DateBaseImplement/DBContext.cs +++ b/WinFormsProject/DateBaseImplement/DBContext.cs @@ -14,7 +14,7 @@ namespace DateBaseImplement protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured) - optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=COP;Username=postgres;Password=postgres"); + optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=COPArtyom;Username=courseuser;Password=courseuser"); base.OnConfiguring(optionsBuilder); } diff --git a/WinFormsProject/DateBaseImplement/Migrations/20231214060747_initMigrationMax.Designer.cs b/WinFormsProject/DateBaseImplement/Migrations/20231214060747_initMigrationMax.Designer.cs new file mode 100644 index 0000000..e2a7dc4 --- /dev/null +++ b/WinFormsProject/DateBaseImplement/Migrations/20231214060747_initMigrationMax.Designer.cs @@ -0,0 +1,75 @@ +// +using DateBaseImplement; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace DateBaseImplement.Migrations +{ + [DbContext(typeof(DBContext))] + [Migration("20231214060747_initMigrationMax")] + partial class initMigrationMax + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("DateBaseImplement.Models.Provider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Logo") + .IsRequired() + .HasColumnType("bytea"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Number") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Providers"); + }); + + modelBuilder.Entity("DateBaseImplement.Models.Type", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Types"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/WinFormsProject/DateBaseImplement/Migrations/20231214060747_initMigrationMax.cs b/WinFormsProject/DateBaseImplement/Migrations/20231214060747_initMigrationMax.cs new file mode 100644 index 0000000..b3bfc06 --- /dev/null +++ b/WinFormsProject/DateBaseImplement/Migrations/20231214060747_initMigrationMax.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace DateBaseImplement.Migrations +{ + /// + public partial class initMigrationMax : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/WinFormsProject/DateBaseImplement/Models/Type.cs b/WinFormsProject/DateBaseImplement/Models/Type.cs index 62d4db3..894c0c0 100644 --- a/WinFormsProject/DateBaseImplement/Models/Type.cs +++ b/WinFormsProject/DateBaseImplement/Models/Type.cs @@ -30,7 +30,7 @@ namespace DateBaseImplement.Models public void Update(TypeBindingModel model) { if (model == null) return; - model.Name = Name; + Name = model.Name; } public TypeViewModel GetViewModel => new()