From 368338db8231b5cc1e9d844f68ee41d93b3cf141 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?=
 =?UTF-8?q?=D0=B8=D0=BC?= <kashin20031984@mail.ru>
Date: Mon, 27 Mar 2023 23:30:52 +0400
Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=90=D0=9A=D0=9E=D0=9D=D0=95=D0=A6=20?=
 =?UTF-8?q?=D0=A2=D0=9E=20=D0=9F=D0=9E=D0=94=D0=9A=D0=9B=D0=AE=D0=A7=D0=98?=
 =?UTF-8?q?=D0=9B=D0=A1=D0=AF=20=D0=9A=20API=20+=20fix=20form?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../FormClients.Designer.cs                     |  3 +++
 .../PrecastConcretePlant/FormClients.cs         | 17 +++++++++++------
 .../PrecastConcretePlantClientApp/Program.cs    |  4 ++++
 .../appsettings.json                            |  2 +-
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/PrecastConcretePlant/PrecastConcretePlant/FormClients.Designer.cs b/PrecastConcretePlant/PrecastConcretePlant/FormClients.Designer.cs
index ed46894..f51f5b6 100644
--- a/PrecastConcretePlant/PrecastConcretePlant/FormClients.Designer.cs
+++ b/PrecastConcretePlant/PrecastConcretePlant/FormClients.Designer.cs
@@ -44,6 +44,7 @@
             this.buttonRef.TabIndex = 9;
             this.buttonRef.Text = "Обновить";
             this.buttonRef.UseVisualStyleBackColor = true;
+            this.buttonRef.Click += new System.EventHandler(this.buttonRef_Click);
             // 
             // buttonDel
             // 
@@ -55,6 +56,7 @@
             this.buttonDel.TabIndex = 8;
             this.buttonDel.Text = "Удалить";
             this.buttonDel.UseVisualStyleBackColor = true;
+            this.buttonDel.Click += new System.EventHandler(this.buttonDel_Click);
             // 
             // dataGridView
             // 
@@ -81,6 +83,7 @@
             this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.Name = "FormClients";
             this.Text = "Клиенты";
+            this.Load += new System.EventHandler(this.FormClients_Load);
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
             this.ResumeLayout(false);
 
diff --git a/PrecastConcretePlant/PrecastConcretePlant/FormClients.cs b/PrecastConcretePlant/PrecastConcretePlant/FormClients.cs
index 0cf7f6d..2c6313b 100644
--- a/PrecastConcretePlant/PrecastConcretePlant/FormClients.cs
+++ b/PrecastConcretePlant/PrecastConcretePlant/FormClients.cs
@@ -23,10 +23,7 @@ namespace PrecastConcretePlantView
             _logger = logger;
             _logic = logic;
         }
-        private void FormViewClients_Load(object sender, EventArgs e)
-        {
-            LoadData();
-        }
+
         private void LoadData()
         {
             try
@@ -47,7 +44,9 @@ namespace PrecastConcretePlantView
                 MessageBoxIcon.Error);
             }
         }
-        private void ButtonDel_Click(object sender, EventArgs e)
+        
+
+        private void buttonDel_Click(object sender, EventArgs e)
         {
             if (dataGridView.SelectedRows.Count == 1)
             {
@@ -76,7 +75,13 @@ namespace PrecastConcretePlantView
                 }
             }
         }
-        private void ButtonRef_Click(object sender, EventArgs e)
+
+        private void buttonRef_Click(object sender, EventArgs e)
+        {
+            LoadData();
+        }
+
+        private void FormClients_Load(object sender, EventArgs e)
         {
             LoadData();
         }
diff --git a/PrecastConcretePlant/PrecastConcretePlantClientApp/Program.cs b/PrecastConcretePlant/PrecastConcretePlantClientApp/Program.cs
index 0727468..82ba3ae 100644
--- a/PrecastConcretePlant/PrecastConcretePlantClientApp/Program.cs
+++ b/PrecastConcretePlant/PrecastConcretePlantClientApp/Program.cs
@@ -1,3 +1,5 @@
+using PrecastConcretePlantClientApp;
+
 var builder = WebApplication.CreateBuilder(args);
 
 // Add services to the container.
@@ -5,6 +7,8 @@ builder.Services.AddControllersWithViews();
 
 var app = builder.Build();
 
+APIClient.Connect(builder.Configuration);
+
 // Configure the HTTP request pipeline.
 if (!app.Environment.IsDevelopment())
 {
diff --git a/PrecastConcretePlant/PrecastConcretePlantClientApp/appsettings.json b/PrecastConcretePlant/PrecastConcretePlantClientApp/appsettings.json
index 9f1b51d..8d47a78 100644
--- a/PrecastConcretePlant/PrecastConcretePlantClientApp/appsettings.json
+++ b/PrecastConcretePlant/PrecastConcretePlantClientApp/appsettings.json
@@ -6,5 +6,5 @@
     }
   },
   "AllowedHosts": "*",
-  "IPAddress": "http://localhost:5197/"
+  "IPAddress": "http://localhost:5197"
 }