private void Result_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(Screen.Text)) { MessageBox.Show("Введите число и выберите операцию"); return; } b = Convert.ToInt32(Screen.Text); switch (operation) { case eOperation.empty: MessageBox.Show("Выберите операцию и введите второе число"); break; case eOperation.addition: Screen.Text = Controller.Addition(a, b); break; case eOperation.subtraction: Screen.Text = Controller.Substraction(a, b); break; case eOperation.multiplication: Screen.Text = Controller.Multiplication(a, b); break; case eOperation.division: try { Screen.Text = Controller.Division(a, b); } catch (Exception ex) { MessageBox.Show(ex.Message); } break; default: MessageBox.Show("Ошибка операции"); break; } }