ПИбд-23 Насыров Артур Газинурович Лабораторная работа №2 #3
2
ProjectFlowerShop/FormFlower.Designer.cs
generated
2
ProjectFlowerShop/FormFlower.Designer.cs
generated
@ -1,6 +1,6 @@
|
||||
namespace ProjectFlowerShop
|
||||
{
|
||||
partial class FormProduct
|
||||
partial class FormFlower
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
@ -15,7 +15,7 @@ using System.Windows.Forms;
|
||||
|
||||
namespace ProjectFlowerShop
|
||||
{
|
||||
public partial class FormProduct : Form
|
||||
public partial class FormFlower : Form
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IFlowerLogic _logic;
|
||||
@ -23,7 +23,7 @@ namespace ProjectFlowerShop
|
||||
private Dictionary<int, (IComponentModel, int)> _flowerComponents;
|
||||
public int Id { set { _id = value; } }
|
||||
|
||||
public FormProduct(ILogger<FormProduct> logger, IFlowerLogic logic)
|
||||
public FormFlower(ILogger<FormFlower> logger, IFlowerLogic logic)
|
||||
{
|
||||
InitializeComponent();
|
||||
_logger = logger;
|
||||
|
@ -53,8 +53,8 @@ namespace ProjectFlowerShop
|
||||
|
||||
private void AddButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormProduct));
|
||||
if (service is FormProduct form)
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormFlower));
|
||||
if (service is FormFlower form)
|
||||
{
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
@ -67,8 +67,8 @@ namespace ProjectFlowerShop
|
||||
{
|
||||
if (DataGridView.SelectedRows.Count == 1)
|
||||
{
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormProduct));
|
||||
if (service is FormProduct form)
|
||||
var service = Program.ServiceProvider?.GetService(typeof(FormFlower));
|
||||
if (service is FormFlower form)
|
||||
{
|
||||
var tmp = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
form.Id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
|
@ -44,7 +44,7 @@ namespace ProjectFlowerShop
|
||||
services.AddTransient<ComponentForm>();
|
||||
services.AddTransient<FormComponents>();
|
||||
services.AddTransient<FormCreateOrder>();
|
||||
services.AddTransient<FormProduct>();
|
||||
services.AddTransient<FormFlower>();
|
||||
services.AddTransient<FormFlowerComponent>();
|
||||
services.AddTransient<FormFlowers>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user