привел лабу к нормальному виду

This commit is contained in:
Extrimal 2024-06-16 15:24:07 +04:00
parent b8d0215f66
commit 1e396c5ed9
11 changed files with 196 additions and 342 deletions

View File

@ -14,7 +14,7 @@ namespace GarmentFactoryDatabaseImplement
{ {
if (optionsBuilder.IsConfigured == false) if (optionsBuilder.IsConfigured == false)
{ {
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS01;Initial Catalog=GarmentFactoryDatabaseFulll;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS01;Initial Catalog=GarmentFactoryDatabaseFulll5Laba;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
} }
base.OnConfiguring(optionsBuilder); base.OnConfiguring(optionsBuilder);
} }
@ -23,9 +23,9 @@ namespace GarmentFactoryDatabaseImplement
public virtual DbSet<TextileComponent> TextileComponents { set; get; } public virtual DbSet<TextileComponent> TextileComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; } public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Client> Clients { set; get; } public virtual DbSet<Client> Clients { set; get; }
}
public virtual DbSet<Shop> Shops { set; get; } public virtual DbSet<Shop> Shops { set; get; }
public virtual DbSet<ShopTextile> ShopTextiles { set; get; } public virtual DbSet<ShopTextile> ShopTextiles { set; get; }
} }
} }

View File

@ -1,214 +0,0 @@
// <auto-generated />
using System;
using GarmentFactoryDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GarmentFactoryDatabaseImplement.Migrations
{
[DbContext(typeof(GarmentFactoryDatabase))]
[Migration("20240407190354_ClientAddition")]
partial class ClientAddition
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.16")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Component", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ComponentName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<double>("Cost")
.HasColumnType("float");
b.HasKey("Id");
b.ToTable("Components");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.Property<DateTime>("DateCreate")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateImplement")
.HasColumnType("datetime2");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("Sum")
.HasColumnType("float");
b.Property<int>("TextileId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ClientId");
b.HasIndex("TextileId");
b.ToTable("Orders");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Textile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<double>("Price")
.HasColumnType("float");
b.Property<string>("TextileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Textiles");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.TextileComponent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ComponentId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("TextileId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ComponentId");
b.HasIndex("TextileId");
b.ToTable("TextileComponents");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Order", b =>
{
b.HasOne("GarmentFactoryDatabaseImplement.Models.Client", "Client")
.WithMany("Orders")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GarmentFactoryDatabaseImplement.Models.Textile", "Textile")
.WithMany("Orders")
.HasForeignKey("TextileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
b.Navigation("Textile");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.TextileComponent", b =>
{
b.HasOne("GarmentFactoryDatabaseImplement.Models.Component", "Component")
.WithMany("TextileComponents")
.HasForeignKey("ComponentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GarmentFactoryDatabaseImplement.Models.Textile", "Textile")
.WithMany("Components")
.HasForeignKey("TextileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Component");
b.Navigation("Textile");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Client", b =>
{
b.Navigation("Orders");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Component", b =>
{
b.Navigation("TextileComponents");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Textile", b =>
{
b.Navigation("Components");
b.Navigation("Orders");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,68 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GarmentFactoryDatabaseImplement.Migrations
{
/// <inheritdoc />
public partial class ClientAddition : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "ClientId",
table: "Orders",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "Clients",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ClientFIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
Password = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Clients", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Orders_ClientId",
table: "Orders",
column: "ClientId");
migrationBuilder.AddForeignKey(
name: "FK_Orders_Clients_ClientId",
table: "Orders",
column: "ClientId",
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Orders_Clients_ClientId",
table: "Orders");
migrationBuilder.DropTable(
name: "Clients");
migrationBuilder.DropIndex(
name: "IX_Orders_ClientId",
table: "Orders");
migrationBuilder.DropColumn(
name: "ClientId",
table: "Orders");
}
}
}

View File

@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GarmentFactoryDatabaseImplement.Migrations namespace GarmentFactoryDatabaseImplement.Migrations
{ {
[DbContext(typeof(GarmentFactoryDatabase))] [DbContext(typeof(GarmentFactoryDatabase))]
[Migration("20240419160846_ImplementerAddition")] [Migration("20240616112027_InitialMigration")]
partial class ImplementerAddition partial class InitialMigration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -25,6 +25,31 @@ namespace GarmentFactoryDatabaseImplement.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Component", b => modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Component", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -53,6 +78,9 @@ namespace GarmentFactoryDatabaseImplement.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<int>("Count") b.Property<int>("Count")
.HasColumnType("int"); .HasColumnType("int");
@ -73,6 +101,8 @@ namespace GarmentFactoryDatabaseImplement.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId");
b.HasIndex("TextileId"); b.HasIndex("TextileId");
b.ToTable("Orders"); b.ToTable("Orders");
@ -179,12 +209,20 @@ namespace GarmentFactoryDatabaseImplement.Migrations
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Order", b => modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Order", b =>
{ {
b.HasOne("GarmentFactoryDatabaseImplement.Models.Client", "Client")
.WithMany("Orders")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GarmentFactoryDatabaseImplement.Models.Textile", "Textile") b.HasOne("GarmentFactoryDatabaseImplement.Models.Textile", "Textile")
.WithMany("Orders") .WithMany("Orders")
.HasForeignKey("TextileId") .HasForeignKey("TextileId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
b.Navigation("Textile"); b.Navigation("Textile");
}); });
@ -226,6 +264,11 @@ namespace GarmentFactoryDatabaseImplement.Migrations
b.Navigation("Textile"); b.Navigation("Textile");
}); });
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Client", b =>
{
b.Navigation("Orders");
});
modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Component", b => modelBuilder.Entity("GarmentFactoryDatabaseImplement.Models.Component", b =>
{ {
b.Navigation("TextileComponents"); b.Navigation("TextileComponents");

View File

@ -6,11 +6,25 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace GarmentFactoryDatabaseImplement.Migrations namespace GarmentFactoryDatabaseImplement.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class ImplementerAddition : Migration public partial class InitialMigration : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.CreateTable(
name: "Clients",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ClientFIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
Password = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Clients", x => x.Id);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Components", name: "Components",
@ -63,6 +77,7 @@ namespace GarmentFactoryDatabaseImplement.Migrations
Id = table.Column<int>(type: "int", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"), .Annotation("SqlServer:Identity", "1, 1"),
TextileId = table.Column<int>(type: "int", nullable: false), TextileId = table.Column<int>(type: "int", nullable: false),
ClientId = table.Column<int>(type: "int", nullable: false),
Count = table.Column<int>(type: "int", nullable: false), Count = table.Column<int>(type: "int", nullable: false),
Sum = table.Column<double>(type: "float", nullable: false), Sum = table.Column<double>(type: "float", nullable: false),
Status = table.Column<int>(type: "int", nullable: false), Status = table.Column<int>(type: "int", nullable: false),
@ -72,6 +87,12 @@ namespace GarmentFactoryDatabaseImplement.Migrations
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_Orders", x => x.Id); table.PrimaryKey("PK_Orders", x => x.Id);
table.ForeignKey(
name: "FK_Orders_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_Orders_Textiles_TextileId", name: "FK_Orders_Textiles_TextileId",
column: x => x.TextileId, column: x => x.TextileId,
@ -134,6 +155,11 @@ namespace GarmentFactoryDatabaseImplement.Migrations
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateIndex(
name: "IX_Orders_ClientId",
table: "Orders",
column: "ClientId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Orders_TextileId", name: "IX_Orders_TextileId",
table: "Orders", table: "Orders",
@ -163,7 +189,6 @@ namespace GarmentFactoryDatabaseImplement.Migrations
/// <inheritdoc /> /// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Orders"); name: "Orders");
@ -173,6 +198,9 @@ namespace GarmentFactoryDatabaseImplement.Migrations
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "TextileComponents"); name: "TextileComponents");
migrationBuilder.DropTable(
name: "Clients");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Shops"); name: "Shops");

View File

@ -11,19 +11,27 @@ namespace GarmentFactoryFileImplement
internal class DataFileSingleton internal class DataFileSingleton
{ {
private static DataFileSingleton? instance; private static DataFileSingleton? instance;
private readonly string ComponentFileName = "Component.xml"; private readonly string ComponentFileName = "Component.xml";
private readonly string OrderFileName = "Order.xml"; private readonly string OrderFileName = "Order.xml";
private readonly string TextileFileName = "Textile.xml"; private readonly string TextileFileName = "Textile.xml";
private readonly string ClientFileName = "Client.xml"; private readonly string ClientFileName = "Client.xml";
public List<Component> Components { get; private set; }
private readonly string ShopFileName = "Shop.xml"; private readonly string ShopFileName = "Shop.xml";
public List<Component> Components { get; private set; } public List<Component> Components { get; private set; }
public List<Order> Orders { get; private set; } public List<Order> Orders { get; private set; }
public List<Textile> Textils { get; private set; }
public List<Client> Clients { get; private set; }
public static DataFileSingleton GetInstance()
public List<Textile> Textiles { get; private set; } public List<Textile> Textiles { get; private set; }
public List<Client> Clients { get; private set; }
public List<Shop> Shops { get; private set; } public List<Shop> Shops { get; private set; }
public static DataFileSingleton GetInstance() public static DataFileSingleton GetInstance()
{ {
if (instance == null) if (instance == null)
@ -32,33 +40,36 @@ namespace GarmentFactoryFileImplement
} }
return instance; return instance;
} }
public void SaveComponents() => SaveData(Components, ComponentFileName, "Components", x => x.GetXElement); public void SaveComponents() => SaveData(Components, ComponentFileName, "Components", x => x.GetXElement);
public void SaveTextiles() => SaveData(Textiles, TextileFileName, "Textiles", x => x.GetXElement); public void SaveTextiles() => SaveData(Textiles, TextileFileName, "Textiles", x => x.GetXElement);
public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement); public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement);
public void SaveClients() => SaveData(Clients, ClientFileName, "Clients", x => x.GetXElement); public void SaveClients() => SaveData(Clients, ClientFileName, "Clients", x => x.GetXElement);
private DataFileSingleton()
public void SaveShops() => SaveData(Shops, ShopFileName, "Shops", x => x.GetXElement); public void SaveShops() => SaveData(Shops, ShopFileName, "Shops", x => x.GetXElement);
private DataFileSingleton() private DataFileSingleton()
{ {
Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!; Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!;
Textiles = LoadData(TextileFileName, "Textile", x => Textile.Create(x)!)!; Textiles = LoadData(TextileFileName, "Textile", x => Textile.Create(x)!)!;
Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!; Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!;
Clients = LoadData(ClientFileName, "Client", x => Client.Create(x)!)!; Clients = LoadData(ClientFileName, "Client", x => Client.Create(x)!)!;
}
Shops = LoadData(ShopFileName, "Shop", x => Shop.Create(x)!)!; Shops = LoadData(ShopFileName, "Shop", x => Shop.Create(x)!)!;
} }
private static List<T>? LoadData<T>(string filename, string xmlNodeName,
Func<XElement, T> selectFunction) private static List<T>? LoadData<T>(string filename, string xmlNodeName, Func<XElement, T> selectFunction)
{ {
if (File.Exists(filename)) if (File.Exists(filename))
{ {
return return XDocument.Load(filename)?.Root?.Elements(xmlNodeName)?.Select(selectFunction)?.ToList();
XDocument.Load(filename)?.Root?.Elements(xmlNodeName)?.Select(selectFunction)?.ToList();
} }
return new List<T>(); return new List<T>();
} }
private static void SaveData<T>(List<T> data, string filename, string
xmlNodeName, Func<T, XElement> selectFunction) private static void SaveData<T>(List<T> data, string filename, string xmlNodeName, Func<T, XElement> selectFunction)
{ {
if (data != null) if (data != null)
{ {

View File

@ -105,7 +105,7 @@ namespace GarmentFactoryFileImplement.Implements
private OrderViewModel AddIntelligence(OrderViewModel model) private OrderViewModel AddIntelligence(OrderViewModel model)
{ {
var selectedTextile = source.Textils.FirstOrDefault(x => x.Id == model.TextileId); var selectedTextile = source.Textiles.FirstOrDefault(x => x.Id == model.TextileId);
model.TextileName = selectedTextile?.TextileName ?? string.Empty; model.TextileName = selectedTextile?.TextileName ?? string.Empty;
var selectedClient = source.Clients.FirstOrDefault(x => x.Id == model.ClientId); var selectedClient = source.Clients.FirstOrDefault(x => x.Id == model.ClientId);
model.ClientFIO = selectedClient?.ClientFIO ?? string.Empty; model.ClientFIO = selectedClient?.ClientFIO ?? string.Empty;

View File

@ -32,17 +32,23 @@
справочникиToolStripMenuItem = new ToolStripMenuItem(); справочникиToolStripMenuItem = new ToolStripMenuItem();
компонентыToolStripMenuItem = new ToolStripMenuItem(); компонентыToolStripMenuItem = new ToolStripMenuItem();
изделиеToolStripMenuItem = new ToolStripMenuItem(); изделиеToolStripMenuItem = new ToolStripMenuItem();
клиентыToolStripMenuItem = new ToolStripMenuItem();
магазиныToolStripMenuItem = new ToolStripMenuItem();
отчетыToolStripMenuItem = new ToolStripMenuItem(); отчетыToolStripMenuItem = new ToolStripMenuItem();
списокПродуктаToolStripMenuItem = new ToolStripMenuItem(); списокПродуктаToolStripMenuItem = new ToolStripMenuItem();
компонентыПоИзделиямToolStripMenuItem = new ToolStripMenuItem(); компонентыПоИзделиямToolStripMenuItem = new ToolStripMenuItem();
списокЗаказовToolStripMenuItem = new ToolStripMenuItem(); списокЗаказовToolStripMenuItem = new ToolStripMenuItem();
списокМагазиновToolStripMenuItem = new ToolStripMenuItem();
загруженностьМагазиновToolStripMenuItem = new ToolStripMenuItem();
заказыПоДатамToolStripMenuItem = new ToolStripMenuItem();
пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem();
продажаМагазинаToolStripMenuItem = new ToolStripMenuItem();
dataGridView = new DataGridView(); dataGridView = new DataGridView();
buttonCreateOrder = new Button(); buttonCreateOrder = new Button();
buttonTakeOrderInWork = new Button(); buttonTakeOrderInWork = new Button();
buttonOrderReady = new Button(); buttonOrderReady = new Button();
buttonIssuedOrder = new Button(); buttonIssuedOrder = new Button();
buttonUpd = new Button(); buttonUpd = new Button();
клиентыToolStripMenuItem = new ToolStripMenuItem();
menuStrip.SuspendLayout(); menuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout(); SuspendLayout();
@ -50,16 +56,16 @@
// menuStrip // menuStrip
// //
menuStrip.ImageScalingSize = new Size(20, 20); menuStrip.ImageScalingSize = new Size(20, 20);
menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem }); menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem, пополнениеМагазинаToolStripMenuItem, продажаМагазинаToolStripMenuItem });
menuStrip.Location = new Point(0, 0); menuStrip.Location = new Point(0, 0);
menuStrip.Name = "menuStrip"; menuStrip.Name = "menuStrip";
menuStrip.Size = new Size(1178, 28); menuStrip.Size = new Size(1430, 28);
menuStrip.TabIndex = 0; menuStrip.TabIndex = 0;
menuStrip.Text = "menuStrip1"; menuStrip.Text = "menuStrip1";
// //
// справочникиToolStripMenuItem // справочникиToolStripMenuItem
// //
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, изделиеToolStripMenuItem, клиентыToolStripMenuItem }); справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, изделиеToolStripMenuItem, клиентыToolStripMenuItem, магазиныToolStripMenuItem });
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
справочникиToolStripMenuItem.Size = new Size(117, 24); справочникиToolStripMenuItem.Size = new Size(117, 24);
справочникиToolStripMenuItem.Text = "Справочники"; справочникиToolStripMenuItem.Text = "Справочники";
@ -67,20 +73,34 @@
// компонентыToolStripMenuItem // компонентыToolStripMenuItem
// //
компонентыToolStripMenuItem.Name = омпонентыToolStripMenuItem"; компонентыToolStripMenuItem.Name = омпонентыToolStripMenuItem";
компонентыToolStripMenuItem.Size = new Size(224, 26); компонентыToolStripMenuItem.Size = new Size(182, 26);
компонентыToolStripMenuItem.Text = "Компоненты"; компонентыToolStripMenuItem.Text = "Компоненты";
компонентыToolStripMenuItem.Click += КомпонентыToolStripMenuItem_Click; компонентыToolStripMenuItem.Click += КомпонентыToolStripMenuItem_Click;
// //
// изделиеToolStripMenuItem // изделиеToolStripMenuItem
// //
изделиеToolStripMenuItem.Name = "изделиеToolStripMenuItem"; изделиеToolStripMenuItem.Name = "изделиеToolStripMenuItem";
изделиеToolStripMenuItem.Size = new Size(224, 26); изделиеToolStripMenuItem.Size = new Size(182, 26);
изделиеToolStripMenuItem.Text = "Изделие"; изделиеToolStripMenuItem.Text = "Изделие";
изделиеToolStripMenuItem.Click += ИзделиеToolStripMenuItem_Click; изделиеToolStripMenuItem.Click += ИзделиеToolStripMenuItem_Click;
// //
// клиентыToolStripMenuItem
//
клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem";
клиентыToolStripMenuItem.Size = new Size(182, 26);
клиентыToolStripMenuItem.Text = "Клиенты";
клиентыToolStripMenuItem.Click += КлиентыToolStripMenuItem_Click;
//
// магазиныToolStripMenuItem
//
магазиныToolStripMenuItem.Name = агазиныToolStripMenuItem";
магазиныToolStripMenuItem.Size = new Size(182, 26);
магазиныToolStripMenuItem.Text = "Магазины";
магазиныToolStripMenuItem.Click += МагазиныToolStripMenuItem_Click;
//
// отчетыToolStripMenuItem // отчетыToolStripMenuItem
// //
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокПродуктаToolStripMenuItem, компонентыПоИзделиямToolStripMenuItem, списокЗаказовToolStripMenuItem }); отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокПродуктаToolStripMenuItem, компонентыПоИзделиямToolStripMenuItem, списокЗаказовToolStripMenuItem, списокМагазиновToolStripMenuItem, загруженностьМагазиновToolStripMenuItem, заказыПоДатамToolStripMenuItem });
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
отчетыToolStripMenuItem.Size = new Size(73, 24); отчетыToolStripMenuItem.Size = new Size(73, 24);
отчетыToolStripMenuItem.Text = "Отчеты"; отчетыToolStripMenuItem.Text = "Отчеты";
@ -106,6 +126,41 @@
списокЗаказовToolStripMenuItem.Text = "Список заказов"; списокЗаказовToolStripMenuItem.Text = "Список заказов";
списокЗаказовToolStripMenuItem.Click += СписокЗаказовToolStripMenuItem_Click; списокЗаказовToolStripMenuItem.Click += СписокЗаказовToolStripMenuItem_Click;
// //
// списокМагазиновToolStripMenuItem
//
списокМагазиновToolStripMenuItem.Name = "списокМагазиновToolStripMenuItem";
списокМагазиновToolStripMenuItem.Size = new Size(276, 26);
списокМагазиновToolStripMenuItem.Text = "Список магазинов";
списокМагазиновToolStripMenuItem.Click += СписокМагазиновToolStripMenuItem_Click;
//
// загруженностьМагазиновToolStripMenuItem
//
загруженностьМагазиновToolStripMenuItem.Name = агруженностьМагазиновToolStripMenuItem";
загруженностьМагазиновToolStripMenuItem.Size = new Size(276, 26);
загруженностьМагазиновToolStripMenuItem.Text = "Загруженность магазинов";
загруженностьМагазиновToolStripMenuItem.Click += ЗагруженностьМагазиновToolStripMenuItem_Click;
//
// заказыПоДатамToolStripMenuItem
//
заказыПоДатамToolStripMenuItem.Name = аказыПоДатамToolStripMenuItem";
заказыПоДатамToolStripMenuItem.Size = new Size(276, 26);
заказыПоДатамToolStripMenuItem.Text = "Заказы по датам";
заказыПоДатамToolStripMenuItem.Click += ЗаказыПоДатамToolStripMenuItem_Click;
//
// пополнениеМагазинаToolStripMenuItem
//
пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem";
пополнениеМагазинаToolStripMenuItem.Size = new Size(182, 24);
пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина";
пополнениеМагазинаToolStripMenuItem.Click += ПополнениеМагазинаToolStripMenuItem_Click;
//
// продажаМагазинаToolStripMenuItem
//
продажаМагазинаToolStripMenuItem.Name = "продажаМагазинаToolStripMenuItem";
продажаМагазинаToolStripMenuItem.Size = new Size(157, 24);
продажаМагазинаToolStripMenuItem.Text = "Продажа магазина";
продажаМагазинаToolStripMenuItem.Click += ПродажаИзделияToolStripMenuItem_Click;
//
// dataGridView // dataGridView
// //
dataGridView.AllowUserToAddRows = false; dataGridView.AllowUserToAddRows = false;
@ -120,12 +175,12 @@
dataGridView.RowHeadersWidth = 51; dataGridView.RowHeadersWidth = 51;
dataGridView.RowTemplate.Height = 29; dataGridView.RowTemplate.Height = 29;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(944, 427); dataGridView.Size = new Size(1196, 427);
dataGridView.TabIndex = 1; dataGridView.TabIndex = 1;
// //
// buttonCreateOrder // buttonCreateOrder
// //
buttonCreateOrder.Location = new Point(965, 77); buttonCreateOrder.Location = new Point(1219, 65);
buttonCreateOrder.Name = "buttonCreateOrder"; buttonCreateOrder.Name = "buttonCreateOrder";
buttonCreateOrder.Size = new Size(199, 36); buttonCreateOrder.Size = new Size(199, 36);
buttonCreateOrder.TabIndex = 2; buttonCreateOrder.TabIndex = 2;
@ -135,7 +190,7 @@
// //
// buttonTakeOrderInWork // buttonTakeOrderInWork
// //
buttonTakeOrderInWork.Location = new Point(965, 149); buttonTakeOrderInWork.Location = new Point(1219, 137);
buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
buttonTakeOrderInWork.Size = new Size(199, 36); buttonTakeOrderInWork.Size = new Size(199, 36);
buttonTakeOrderInWork.TabIndex = 3; buttonTakeOrderInWork.TabIndex = 3;
@ -145,7 +200,7 @@
// //
// buttonOrderReady // buttonOrderReady
// //
buttonOrderReady.Location = new Point(963, 222); buttonOrderReady.Location = new Point(1217, 210);
buttonOrderReady.Name = "buttonOrderReady"; buttonOrderReady.Name = "buttonOrderReady";
buttonOrderReady.Size = new Size(199, 36); buttonOrderReady.Size = new Size(199, 36);
buttonOrderReady.TabIndex = 4; buttonOrderReady.TabIndex = 4;
@ -155,7 +210,7 @@
// //
// buttonIssuedOrder // buttonIssuedOrder
// //
buttonIssuedOrder.Location = new Point(965, 305); buttonIssuedOrder.Location = new Point(1219, 293);
buttonIssuedOrder.Name = "buttonIssuedOrder"; buttonIssuedOrder.Name = "buttonIssuedOrder";
buttonIssuedOrder.Size = new Size(199, 36); buttonIssuedOrder.Size = new Size(199, 36);
buttonIssuedOrder.TabIndex = 5; buttonIssuedOrder.TabIndex = 5;
@ -165,7 +220,7 @@
// //
// buttonUpd // buttonUpd
// //
buttonUpd.Location = new Point(965, 384); buttonUpd.Location = new Point(1219, 372);
buttonUpd.Name = "buttonUpd"; buttonUpd.Name = "buttonUpd";
buttonUpd.Size = new Size(197, 36); buttonUpd.Size = new Size(197, 36);
buttonUpd.TabIndex = 6; buttonUpd.TabIndex = 6;
@ -173,18 +228,11 @@
buttonUpd.UseVisualStyleBackColor = true; buttonUpd.UseVisualStyleBackColor = true;
buttonUpd.Click += ButtonUpd_Click; buttonUpd.Click += ButtonUpd_Click;
// //
// клиентыToolStripMenuItem
//
клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem";
клиентыToolStripMenuItem.Size = new Size(224, 26);
клиентыToolStripMenuItem.Text = "Клиенты";
клиентыToolStripMenuItem.Click += КлиентыToolStripMenuItem_Click;
//
// FormMain // FormMain
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1178, 463); ClientSize = new Size(1430, 463);
Controls.Add(buttonUpd); Controls.Add(buttonUpd);
Controls.Add(buttonIssuedOrder); Controls.Add(buttonIssuedOrder);
Controls.Add(buttonOrderReady); Controls.Add(buttonOrderReady);
@ -221,5 +269,11 @@
private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem; private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem;
private ToolStripMenuItem списокЗаказовToolStripMenuItem; private ToolStripMenuItem списокЗаказовToolStripMenuItem;
private ToolStripMenuItem клиентыToolStripMenuItem; private ToolStripMenuItem клиентыToolStripMenuItem;
private ToolStripMenuItem магазиныToolStripMenuItem;
private ToolStripMenuItem пополнениеМагазинаToolStripMenuItem;
private ToolStripMenuItem продажаМагазинаToolStripMenuItem;
private ToolStripMenuItem списокМагазиновToolStripMenuItem;
private ToolStripMenuItem загруженностьМагазиновToolStripMenuItem;
private ToolStripMenuItem заказыПоДатамToolStripMenuItem;
} }
} }

View File

@ -240,5 +240,14 @@ namespace GarmentFactoryView
form.ShowDialog(); form.ShowDialog();
} }
} }
private void КлиентыToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormClients));
if (service is FormClients form)
{
form.ShowDialog();
}
}
} }
} }

View File

@ -34,21 +34,15 @@ namespace GarmentFactoryView
services.AddTransient<IComponentStorage, ComponentStorage>(); services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>(); services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<ITextileStorage, TextileStorage>(); services.AddTransient<ITextileStorage, TextileStorage>();
<<<<<<< HEAD
services.AddTransient<IClientStorage, ClientStorage>(); services.AddTransient<IClientStorage, ClientStorage>();
=======
services.AddTransient<IShopStorage, ShopStorage>(); services.AddTransient<IShopStorage, ShopStorage>();
>>>>>>> laba4_hard
services.AddTransient<IComponentLogic, ComponentLogic>(); services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>(); services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<ITextileLogic, TextileLogic>(); services.AddTransient<ITextileLogic, TextileLogic>();
services.AddTransient<IShopLogic, ShopLogic>(); services.AddTransient<IShopLogic, ShopLogic>();
services.AddTransient<IReportLogic, ReportLogic>(); services.AddTransient<IReportLogic, ReportLogic>();
<<<<<<< HEAD
services.AddTransient<IClientLogic, ClientLogic>(); services.AddTransient<IClientLogic, ClientLogic>();
=======
>>>>>>> laba4_hard
services.AddTransient<AbstractSaveToWord, SaveToWord>(); services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToExcel, SaveToExcel>(); services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
@ -67,12 +61,9 @@ namespace GarmentFactoryView
services.AddTransient<FormTextileSale>(); services.AddTransient<FormTextileSale>();
services.AddTransient<FormReportTextileComponents>(); services.AddTransient<FormReportTextileComponents>();
services.AddTransient<FormReportOrders>(); services.AddTransient<FormReportOrders>();
<<<<<<< HEAD
services.AddTransient<FormClients>(); services.AddTransient<FormClients>();
=======
services.AddTransient<FormReportShopTextiles>(); services.AddTransient<FormReportShopTextiles>();
services.AddTransient<FormReportGroupedOrders>(); services.AddTransient<FormReportGroupedOrders>();
>>>>>>> laba4_hard
} }
} }