private void button1_Click(object sender, EventArgs e) { try { questionLogic.CreateOrUpdate(new QuestionBindModel { Id = id, quest = textBoxName.Text, answers = textBoxANS1.Text + ' ' + textBoxANS2.Text + ' ' + textBoxANS3.Text + ' ' + textBoxANS4.Text, rightNum = Convert.ToInt32(textBoxRIGHT.Text) }); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } DialogResult = DialogResult.OK; Close(); }