private void FormChef_Load(object sender, EventArgs e) { if (id.HasValue) { try { ChefViewModel view = service.GetElement(id.Value); if (view != null) { textBoxFIO.Text = view.ChefFIO; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }