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

Closed
gaillard wants to merge 12 commits from lab1 into main
6 changed files with 7 additions and 7 deletions
Showing only changes of commit 54eed0d5d7 - Show all commits

View File

@ -95,8 +95,8 @@ namespace ProjectFlowerShop
private void buttonAdd_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormProductComponent));
if (service is FormProductComponent form)
var service = Program.ServiceProvider?.GetService(typeof(FormFlowerComponent));
if (service is FormFlowerComponent form)
{
if (form.ShowDialog() == DialogResult.OK)
{
@ -124,8 +124,8 @@ namespace ProjectFlowerShop
if (dataGridView.SelectedRows.Count == 1)
{
var service =
Program.ServiceProvider?.GetService(typeof(FormProductComponent));
if (service is FormProductComponent form)
Program.ServiceProvider?.GetService(typeof(FormFlowerComponent));
if (service is FormFlowerComponent form)
{
int id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value);

View File

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

View File

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