This commit is contained in:
antoc0der 2024-02-27 13:05:58 +03:00
parent 05dc9185d6
commit d1dff985e1
8 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
namespace ProjectFlowerShop namespace ProjectFlowerShop
{ {
partial class FormProduct partial class FormFlower
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@ -15,7 +15,7 @@ using System.Windows.Forms;
namespace ProjectFlowerShop namespace ProjectFlowerShop
{ {
public partial class FormProduct : Form public partial class FormFlower : Form
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IFlowerLogic _logic; private readonly IFlowerLogic _logic;
@ -23,7 +23,7 @@ namespace ProjectFlowerShop
private Dictionary<int, (IComponentModel, int)> _flowerComponents; private Dictionary<int, (IComponentModel, int)> _flowerComponents;
public int Id { set { _id = value; } } public int Id { set { _id = value; } }
public FormProduct(ILogger<FormProduct> logger, IFlowerLogic logic) public FormFlower(ILogger<FormFlower> logger, IFlowerLogic logic)
{ {
InitializeComponent(); InitializeComponent();
_logger = logger; _logger = logger;
@ -95,8 +95,8 @@ namespace ProjectFlowerShop
private void buttonAdd_Click(object sender, EventArgs e) private void buttonAdd_Click(object sender, EventArgs e)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormProductComponent)); var service = Program.ServiceProvider?.GetService(typeof(FormFlowerComponent));
if (service is FormProductComponent form) if (service is FormFlowerComponent form)
{ {
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
{ {
@ -124,8 +124,8 @@ namespace ProjectFlowerShop
if (dataGridView.SelectedRows.Count == 1) if (dataGridView.SelectedRows.Count == 1)
{ {
var service = var service =
Program.ServiceProvider?.GetService(typeof(FormProductComponent)); Program.ServiceProvider?.GetService(typeof(FormFlowerComponent));
if (service is FormProductComponent form) if (service is FormFlowerComponent form)
{ {
int id = int id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value); Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value);

View File

@ -1,6 +1,6 @@
namespace ProjectFlowerShop namespace ProjectFlowerShop
{ {
partial class FormProductComponent partial class FormFlowerComponent
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.

View File

@ -13,7 +13,7 @@ using System.Windows.Forms;
namespace ProjectFlowerShop namespace ProjectFlowerShop
{ {
public partial class FormProductComponent : Form public partial class FormFlowerComponent : Form
{ {
private readonly List<ComponentViewModel>? _list; private readonly List<ComponentViewModel>? _list;
public int Id public int Id
@ -52,7 +52,7 @@ namespace ProjectFlowerShop
set set
{ textBoxNumber.Text = value.ToString(); } { textBoxNumber.Text = value.ToString(); }
} }
public FormProductComponent(IComponentLogic logic) public FormFlowerComponent(IComponentLogic logic)
{ {
InitializeComponent(); InitializeComponent();
_list = logic.ReadList(null); _list = logic.ReadList(null);

View File

@ -53,8 +53,8 @@ namespace ProjectFlowerShop
private void AddButton_Click(object sender, EventArgs e) private void AddButton_Click(object sender, EventArgs e)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormProduct)); var service = Program.ServiceProvider?.GetService(typeof(FormFlower));
if (service is FormProduct form) if (service is FormFlower form)
{ {
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
{ {
@ -67,8 +67,8 @@ namespace ProjectFlowerShop
{ {
if (DataGridView.SelectedRows.Count == 1) if (DataGridView.SelectedRows.Count == 1)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormProduct)); var service = Program.ServiceProvider?.GetService(typeof(FormFlower));
if (service is FormProduct form) if (service is FormFlower form)
{ {
var tmp = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); var tmp = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value);
form.Id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); form.Id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value);

View File

@ -47,8 +47,8 @@ namespace ProjectFlowerShop
services.AddTransient<ComponentForm>(); services.AddTransient<ComponentForm>();
services.AddTransient<FormComponents>(); services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>(); services.AddTransient<FormCreateOrder>();
services.AddTransient<FormProduct>(); services.AddTransient<FormFlower>();
services.AddTransient<FormProductComponent>(); services.AddTransient<FormFlowerComponent>();
services.AddTransient<FormFlowers>(); services.AddTransient<FormFlowers>();
services.AddTransient<ShopForm>(); services.AddTransient<ShopForm>();
services.AddTransient<ShopsForm>(); services.AddTransient<ShopsForm>();