using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace BookShopView { public partial class FormClients : Form { public FormClients() { InitializeComponent(); } private void buttonAdd_Click(object sender, EventArgs e) { var service = Program.ServiceProvider?.GetService(typeof(FormClient)); if (service is FormClient form) { if (form.ShowDialog() == DialogResult.OK) { //LoadData(); } } } } }