lab1 hard

This commit is contained in:
aleksandr chegodaev 2024-06-16 21:52:02 +04:00
commit d1ab88d0e7
10 changed files with 83 additions and 142 deletions

View File

@ -28,21 +28,20 @@
/// </summary>
private void InitializeComponent()
{
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.toolStripMenuItemCatalogs = new System.Windows.Forms.ToolStripMenuItem();
this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.пакетыДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.buttonCreateOrder = new System.Windows.Forms.Button();
this.buttonTakeOrderInWork = new System.Windows.Forms.Button();
this.buttonOrderReady = new System.Windows.Forms.Button();
this.buttonIssuedOrder = new System.Windows.Forms.Button();
this.buttonRef = new System.Windows.Forms.Button();
this.магазиныToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buttonSupplyShop = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
toolStrip1 = new ToolStrip();
toolStripDropDownButton1 = new ToolStripDropDownButton();
компонентыToolStripMenuItem = new ToolStripMenuItem();
ПутёвкиToolStripMenuItem = new ToolStripMenuItem();
buttonCreateOrder = new Button();
buttonTakeOrderInWork = new Button();
buttonOrderReady = new Button();
buttonIssuedOrder = new Button();
buttonRef = new Button();
dataGridView = new DataGridView();
toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// menuStrip1
//
@ -56,13 +55,13 @@
//
// toolStripMenuItemCatalogs
//
this.toolStripMenuItemCatalogs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.компонентыToolStripMenuItem,
this.пакетыДокументовToolStripMenuItem,
this.магазиныToolStripMenuItem});
this.toolStripMenuItemCatalogs.Name = "toolStripMenuItemCatalogs";
this.toolStripMenuItemCatalogs.Size = new System.Drawing.Size(94, 20);
this.toolStripMenuItemCatalogs.Text = "Справочники";
toolStripDropDownButton1.DisplayStyle = ToolStripItemDisplayStyle.Text;
toolStripDropDownButton1.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, ПутёвкиToolStripMenuItem });
toolStripDropDownButton1.Image = (Image)resources.GetObject("toolStripDropDownButton1.Image");
toolStripDropDownButton1.ImageTransparentColor = Color.Magenta;
toolStripDropDownButton1.Name = "toolStripDropDownButton1";
toolStripDropDownButton1.Size = new Size(88, 22);
toolStripDropDownButton1.Text = "Справочник";
//
// компонентыToolStripMenuItem
//
@ -129,54 +128,46 @@
//
// buttonRef
//
this.buttonRef.Location = new System.Drawing.Point(742, 158);
this.buttonRef.Name = "buttonRef";
this.buttonRef.Size = new System.Drawing.Size(156, 23);
this.buttonRef.TabIndex = 6;
this.buttonRef.Text = "Обновить список";
this.buttonRef.UseVisualStyleBackColor = true;
this.buttonRef.Click += new System.EventHandler(this.buttonRef_Click);
buttonRef.Location = new Point(800, 222);
buttonRef.Name = "buttonRef";
buttonRef.Size = new Size(141, 24);
buttonRef.TabIndex = 5;
buttonRef.Text = "Обновить список";
buttonRef.UseVisualStyleBackColor = true;
buttonRef.Click += buttonRef_Click;
//
// магазиныToolStripMenuItem
// dataGridView
//
this.магазиныToolStripMenuItem.Name = агазиныToolStripMenuItem";
this.магазиныToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
this.магазиныToolStripMenuItem.Text = "Магазины";
this.магазиныToolStripMenuItem.Click += new System.EventHandler(this.магазиныToolStripMenuItem_Click);
//
// buttonSupplyShop
//
this.buttonSupplyShop.Location = new System.Drawing.Point(742, 187);
this.buttonSupplyShop.Name = "buttonSupplyShop";
this.buttonSupplyShop.Size = new System.Drawing.Size(156, 23);
this.buttonSupplyShop.TabIndex = 7;
this.buttonSupplyShop.Text = "Пополнение магазина";
this.buttonSupplyShop.UseVisualStyleBackColor = true;
this.buttonSupplyShop.Click += new System.EventHandler(this.buttonSupplyShop_Click);
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Location = new Point(0, 26);
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RowHeadersWidth = 51;
dataGridView.RowTemplate.Height = 24;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(763, 435);
dataGridView.TabIndex = 6;
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(910, 477);
this.Controls.Add(this.buttonSupplyShop);
this.Controls.Add(this.buttonRef);
this.Controls.Add(this.buttonIssuedOrder);
this.Controls.Add(this.buttonOrderReady);
this.Controls.Add(this.buttonTakeOrderInWork);
this.Controls.Add(this.buttonCreateOrder);
this.Controls.Add(this.dataGridView);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "FormMain";
this.Text = "FormMain";
this.Load += new System.EventHandler(this.FormMain_Load);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(969, 461);
Controls.Add(dataGridView);
Controls.Add(buttonRef);
Controls.Add(buttonIssuedOrder);
Controls.Add(buttonOrderReady);
Controls.Add(buttonTakeOrderInWork);
Controls.Add(buttonCreateOrder);
Controls.Add(toolStrip1);
Name = "FormMain";
Text = "Юридическая фирма";
Load += FormMain_Load;
toolStrip1.ResumeLayout(false);
toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
@ -191,7 +182,9 @@
private Button buttonOrderReady;
private Button buttonIssuedOrder;
private Button buttonRef;
private ToolStripMenuItem магазиныToolStripMenuItem;
private Button buttonSupplyShop;
private DataGridView dataGridView;
private ToolStripDropDownButton toolStripDropDownButton1;
private ToolStripMenuItem компонентыToolStripMenuItem;
private ToolStripMenuItem ПутёвкиToolStripMenuItem;
}
}

View File

@ -164,35 +164,5 @@ namespace LawFirmView
{
LoadData();
}
private OrderBindingModel CreateBindingModel(int id, bool isDone = false)
{
return new OrderBindingModel
{
Id = id,
DocumentId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["DocumentId"].Value),
Status = Enum.Parse<OrderStatus>(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
};
}
private void buttonSupplyShop_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormShopSupply));
if (service is FormShopSupply form)
{
form.ShowDialog();
}
}
private void магазиныToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormShops));
if (service is FormShops form)
{
form.ShowDialog();
}
}
}
}

View File

@ -9,17 +9,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LawFirmBusinessLogic\LawFirmBusinessLogic.csproj" />
<ProjectReference Include="..\LawFirmContracts\LawFirmContracts.csproj" />
<ProjectReference Include="..\LawFirmListImplement\LawFirmListImplement.csproj" />
</ItemGroup>

View File

@ -36,22 +36,17 @@ namespace LawFirmView
});
services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IDocumentStorage, DocumentStorage>();
services.AddTransient<IShopStorage, ShopStorage>();
services.AddTransient<ILawStorage, LawStorage>();
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IDocumentLogic, DocumentLogic>();
services.AddTransient<IShopLogic, ShopLogic>();
services.AddTransient<ILawLogic, LawLogic>();
services.AddTransient<FormMain>();
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormDocument>();
services.AddTransient<FormDocumentComponent>();
services.AddTransient<FormDocuments>();
services.AddTransient<FormShop>();
services.AddTransient<FormShops>();
services.AddTransient<FormShopSupply>();
services.AddTransient<FormLaw>();
services.AddTransient<FormLawComponent>();
services.AddTransient<FormLaws>();
}
}

View File

@ -7,17 +7,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LawFirmContracts\LawFirmContracts.csproj" />
<ProjectReference Include="..\LawFirmDataModels\LawFirmDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -6,15 +6,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LawFirmDataModels\LawFirmDataModels.csproj" />
</ItemGroup>

View File

@ -6,9 +6,16 @@ using System.Threading.Tasks;
namespace LawFirmContracts.SearchModels
{
<<<<<<<< HEAD:LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs
public class ShopSearchModel
{
public int? Id { get; set; }
public string? ShopName { get; set; }
========
public class DocumentSearchModel
{
public int? Id { get; set; }
public string? DocumentName { get; set; }
>>>>>>>> lab1:LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs
}
}

View File

@ -6,9 +6,16 @@ using System.Threading.Tasks;
namespace LawFirmContracts.SearchModels
{
<<<<<<<< HEAD:LawFirm/LawFirmContracts/SearchModels/ShopSearchModel.cs
public class ShopSearchModel
{
public int? Id { get; set; }
public string? ShopName { get; set; }
========
public class DocumentSearchModel
{
public int? Id { get; set; }
public string? DocumentName { get; set; }
>>>>>>>> lab1:LawFirm/LawFirmContracts/SearchModels/DocumentSearchModel.cs
}
}

View File

@ -6,13 +6,4 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
</ItemGroup>
</Project>

View File

@ -12,14 +12,12 @@ namespace LawFirmListImplement
private static DataListSingleton? _instance;
public List<Component> Components { get; set; }
public List<Order> Orders { get; set; }
public List<Document> Documents { get; set; }
public List<Shop> Shops { get; set; }
public List<Law> Laws { get; set; }
private DataListSingleton()
{
Components = new List<Component>();
Orders = new List<Order>();
Documents = new List<Document>();
Shops = new List<Shop>();
Laws = new List<Law>();
}
public static DataListSingleton GetInstance()
{