ПИбд-23 Насыров Артур Газинурович Лабораторная работа №2 #3

Closed
gaillard wants to merge 11 commits from lab2 into lab1
4 changed files with 8 additions and 8 deletions
Showing only changes of commit a30528138a - Show all commits

View File

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

View File

@ -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;

View File

@ -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);

View File

@ -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>();
}