Beispiel #1
0
        private void button15_Click(object sender, EventArgs e)
        {
            if (operation_performed == "+")
            {
                textBox_Result.Text = Logic.Add(result_value, Double.Parse(textBox_Result.Text)).ToString();
            }
            else if (operation_performed == "-")
            {
                textBox_Result.Text = Logic.Sub(result_value, Double.Parse(textBox_Result.Text)).ToString();
            }
            else if (operation_performed == "÷")
            {
                if (Double.Parse(textBox_Result.Text) != 0)
                {
                    textBox_Result.Text = Logic.Div(result_value, Double.Parse(textBox_Result.Text)).ToString();
                }
                else
                {
                    iszero = true;
                }
            }
            else if (operation_performed == "NOD")
            {
                textBox_Result.Text = Logic.Nod(result_value, Double.Parse(textBox_Result.Text)).ToString();
            }
            else if (operation_performed == "X")
            {
                textBox_Result.Text = Logic.Times(result_value, Double.Parse(textBox_Result.Text)).ToString();
            }

            if (!iszero)
            {
                result_value = Double.Parse(textBox_Result.Text);
            }
            else if (iszero)
            {
                textBox_Result.Text = "Учи матешу!";
            }
            operation_performed = "";
        }