Exemplo n.º 1
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            string firstOperand  = firstBox.Text;
            string secondOperand = secondBox.Text;

            if (Int32.Parse(firstOperand) >= Int32.Parse(secondOperand))
            {
                try
                {
                    var newSum = new SumAlgorithm();
                    newSum.calculateSum(Int32.Parse(firstOperand),
                                        Int32.Parse(secondOperand));
                }
                catch
                {
                    MessageBox.Show("Invalid input.");
                }
            }
            else
            {
                MessageBox.Show("Invalid input.");
            }
        }
Exemplo n.º 2
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            string firstOperand = firstBox.Text;
            string secondOperand = secondBox.Text;
            if (Int32.Parse(firstOperand) >= Int32.Parse(secondOperand))
            {
                try
                {
                    var newSum = new SumAlgorithm();
                    newSum.calculateSum(Int32.Parse(firstOperand),
                        Int32.Parse(secondOperand));
                }
                catch
                {
                    MessageBox.Show("Invalid input.");
                }
            }
            else
            {
                MessageBox.Show("Invalid input.");

            }
        }