using BeautySaloonContracts.BusinessLogicsContracts; using BeautySaloonContracts.SearchModels; using System.Windows.Forms; namespace BeautySaloonView { public partial class FormReportServices : Form { private readonly IServiceLogic _logic; public FormReportServices(IServiceLogic logic) { InitializeComponent(); _logic = logic; } private void FormReportServices_Load(object sender, EventArgs e) { LoadData(); } private void LoadData() { try { var list = _logic.ReadMostPopular(); if (list != null) { dataGridView.DataSource = list; dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }