Исправление миграции
This commit is contained in:
parent
6ad367e5dd
commit
533d867f42
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(FurnitureAssemblyDatabase))]
|
[DbContext(typeof(FurnitureAssemblyDatabase))]
|
||||||
[Migration("20240506003821_Init")]
|
[Migration("20240515163715_InitialCreate")]
|
||||||
partial class Init
|
partial class InitialCreate
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@ -25,33 +25,6 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Address")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOpen")
|
|
||||||
.HasColumnType("datetime2");
|
|
||||||
|
|
||||||
b.Property<int>("MaxCountFurnitures")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("ShopName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Shops");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -229,6 +202,33 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
b.ToTable("Orders");
|
b.ToTable("Orders");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DateOpen")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("MaxCountFurnitures")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ShopName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Shops");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.ShopFurniture", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.ShopFurniture", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -297,7 +297,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.MessageInfo", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.MessageInfo", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Client", "Client")
|
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Client", "Client")
|
||||||
.WithMany("MessageInfos")
|
.WithMany("Messages")
|
||||||
.HasForeignKey("ClientId");
|
.HasForeignKey("ClientId");
|
||||||
|
|
||||||
b.Navigation("Client");
|
b.Navigation("Client");
|
||||||
@ -336,7 +336,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("BlacksmithWorkshopDatabaseImplement.Models.Shop", "Shop")
|
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Shop", "Shop")
|
||||||
.WithMany("Furnitures")
|
.WithMany("Furnitures")
|
||||||
.HasForeignKey("ShopId")
|
.HasForeignKey("ShopId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -347,14 +347,9 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
b.Navigation("Shop");
|
b.Navigation("Shop");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Furnitures");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("MessageInfos");
|
b.Navigation("Messages");
|
||||||
|
|
||||||
b.Navigation("Orders");
|
b.Navigation("Orders");
|
||||||
});
|
});
|
||||||
@ -373,6 +368,11 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
b.Navigation("Orders");
|
b.Navigation("Orders");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Furnitures");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("FurnitureWorkPieces");
|
b.Navigation("FurnitureWorkPieces");
|
@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class Init : Migration
|
public partial class InitialCreate : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
@ -22,33 +22,6 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Address")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOpen")
|
|
||||||
.HasColumnType("datetime2");
|
|
||||||
|
|
||||||
b.Property<int>("MaxCountFurnitures")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("ShopName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Shops");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -226,6 +199,33 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
b.ToTable("Orders");
|
b.ToTable("Orders");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DateOpen")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("MaxCountFurnitures")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ShopName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Shops");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.ShopFurniture", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.ShopFurniture", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -294,7 +294,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.MessageInfo", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.MessageInfo", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Client", "Client")
|
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Client", "Client")
|
||||||
.WithMany("MessageInfos")
|
.WithMany("Messages")
|
||||||
.HasForeignKey("ClientId");
|
.HasForeignKey("ClientId");
|
||||||
|
|
||||||
b.Navigation("Client");
|
b.Navigation("Client");
|
||||||
@ -333,7 +333,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("BlacksmithWorkshopDatabaseImplement.Models.Shop", "Shop")
|
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Shop", "Shop")
|
||||||
.WithMany("Furnitures")
|
.WithMany("Furnitures")
|
||||||
.HasForeignKey("ShopId")
|
.HasForeignKey("ShopId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -344,14 +344,9 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
b.Navigation("Shop");
|
b.Navigation("Shop");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Furnitures");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("MessageInfos");
|
b.Navigation("Messages");
|
||||||
|
|
||||||
b.Navigation("Orders");
|
b.Navigation("Orders");
|
||||||
});
|
});
|
||||||
@ -370,6 +365,11 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
b.Navigation("Orders");
|
b.Navigation("Orders");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Furnitures");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("FurnitureWorkPieces");
|
b.Navigation("FurnitureWorkPieces");
|
||||||
|
@ -35,7 +35,7 @@ namespace FurnitureAssemblyView
|
|||||||
Dock = DockStyle.Fill
|
Dock = DockStyle.Fill
|
||||||
};
|
};
|
||||||
|
|
||||||
reportViewer.LocalReport.LoadReportDefinition(new FileStream("C:\\Users\\NikBe\\source\\repos\\TP\\Hard\\Lab4\\FurnitureAssembly\\FurnitureAssemblyView\\ReportOrders.rdlc", FileMode.Open));
|
reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrders.rdlc", FileMode.Open));
|
||||||
|
|
||||||
Controls.Clear();
|
Controls.Clear();
|
||||||
Controls.Add(reportViewer);
|
Controls.Add(reportViewer);
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
buttonAdd = new Button();
|
buttonAdd = new Button();
|
||||||
buttonUpdate = new Button();
|
buttonUpdate = new Button();
|
||||||
buttonDelete = new Button();
|
buttonDelete = new Button();
|
||||||
buttonRef = new Button();
|
buttonRefresh = new Button();
|
||||||
dataGridView = new DataGridView();
|
dataGridView = new DataGridView();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
@ -69,16 +69,16 @@
|
|||||||
buttonDelete.UseVisualStyleBackColor = true;
|
buttonDelete.UseVisualStyleBackColor = true;
|
||||||
buttonDelete.Click += ButtonDelete_Click;
|
buttonDelete.Click += ButtonDelete_Click;
|
||||||
//
|
//
|
||||||
// buttonRef
|
// buttonRefresh
|
||||||
//
|
//
|
||||||
buttonRef.Location = new Point(561, 197);
|
buttonRefresh.Location = new Point(561, 197);
|
||||||
buttonRef.Margin = new Padding(3, 2, 3, 2);
|
buttonRefresh.Margin = new Padding(3, 2, 3, 2);
|
||||||
buttonRef.Name = "buttonRef";
|
buttonRefresh.Name = "buttonRefresh";
|
||||||
buttonRef.Size = new Size(100, 34);
|
buttonRefresh.Size = new Size(100, 34);
|
||||||
buttonRef.TabIndex = 3;
|
buttonRefresh.TabIndex = 3;
|
||||||
buttonRef.Text = "Обновить";
|
buttonRefresh.Text = "Обновить";
|
||||||
buttonRef.UseVisualStyleBackColor = true;
|
buttonRefresh.UseVisualStyleBackColor = true;
|
||||||
buttonRef.Click += ButtonRef_Click;
|
buttonRefresh.Click += ButtonRefresh_Click;
|
||||||
//
|
//
|
||||||
// dataGridView
|
// dataGridView
|
||||||
//
|
//
|
||||||
@ -97,7 +97,7 @@
|
|||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(683, 338);
|
ClientSize = new Size(683, 338);
|
||||||
Controls.Add(dataGridView);
|
Controls.Add(dataGridView);
|
||||||
Controls.Add(buttonRef);
|
Controls.Add(buttonRefresh);
|
||||||
Controls.Add(buttonDelete);
|
Controls.Add(buttonDelete);
|
||||||
Controls.Add(buttonUpdate);
|
Controls.Add(buttonUpdate);
|
||||||
Controls.Add(buttonAdd);
|
Controls.Add(buttonAdd);
|
||||||
@ -114,7 +114,7 @@
|
|||||||
private Button buttonAdd;
|
private Button buttonAdd;
|
||||||
private Button buttonUpdate;
|
private Button buttonUpdate;
|
||||||
private Button buttonDelete;
|
private Button buttonDelete;
|
||||||
private Button buttonRef;
|
private Button buttonRefresh;
|
||||||
private DataGridView dataGridView;
|
private DataGridView dataGridView;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -40,7 +40,7 @@ namespace FurnitureAssemblyView
|
|||||||
var list = _logic.ReadList(null);
|
var list = _logic.ReadList(null);
|
||||||
|
|
||||||
// Растягиваем колонку Название на всю ширину, колонку Id скрываем
|
// Растягиваем колонку Название на всю ширину, колонку Id скрываем
|
||||||
if(list != null)
|
if (list != null)
|
||||||
{
|
{
|
||||||
dataGridView.DataSource = list;
|
dataGridView.DataSource = list;
|
||||||
dataGridView.Columns["Id"].Visible = false;
|
dataGridView.Columns["Id"].Visible = false;
|
||||||
@ -49,7 +49,7 @@ namespace FurnitureAssemblyView
|
|||||||
|
|
||||||
_logger.LogInformation("Загрузка заготовок");
|
_logger.LogInformation("Загрузка заготовок");
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Ошибка загрузки заготовок");
|
_logger.LogError(ex, "Ошибка загрузки заготовок");
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ namespace FurnitureAssemblyView
|
|||||||
private void ButtonAdd_Click(object sender, EventArgs e)
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormWorkPiece));
|
var service = Program.ServiceProvider?.GetService(typeof(FormWorkPiece));
|
||||||
|
|
||||||
if (service is FormWorkPiece form)
|
if (service is FormWorkPiece form)
|
||||||
{
|
{
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
@ -120,7 +120,7 @@ namespace FurnitureAssemblyView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonRef_Click(object sender, EventArgs e)
|
private void ButtonRefresh_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,15 @@
|
|||||||
<None Update="App.config">
|
<None Update="App.config">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="nlog.config">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="ReportGroupedOrders.rdlc">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="ReportOrders.rdlc">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -36,4 +45,10 @@
|
|||||||
<ProjectReference Include="..\FurnitureAssemblyListImplement\FurnitureAssemblyListImplement.csproj" />
|
<ProjectReference Include="..\FurnitureAssemblyListImplement\FurnitureAssemblyListImplement.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="FormReportOrders.cs">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
Loading…
x
Reference in New Issue
Block a user