НАКОНЕЦ ТО ПОДКЛЮЧИЛСЯ К API + fix form

This commit is contained in:
Кашин Максим 2023-03-27 23:30:52 +04:00
parent 48d3098e3c
commit 368338db82
4 changed files with 19 additions and 7 deletions

View File

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

View File

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

View File

@ -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())
{

View File

@ -6,5 +6,5 @@
}
},
"AllowedHosts": "*",
"IPAddress": "http://localhost:5197/"
"IPAddress": "http://localhost:5197"
}