private void button1_Click(object sender, EventArgs e)
        {
            int a;
            int b;

            try
            {
                a = int.Parse(textBox1.Text);
                b = int.Parse(textBox2.Text);
            }
            catch (Exception)
            {
                if (textBox1.Text == "")
                {
                    textBox1.Text = "0"; a = 0;
                }
                else
                {
                    a = int.Parse(textBox1.Text);
                }

                if (textBox2.Text == "")
                {
                    textBox2.Text = "0"; b = 0;
                }
                else
                {
                    b = int.Parse(textBox2.Text);
                }
            }
            textBox3.Text = Kalkulacka.Secti(a, b);
        }
Esempio n. 2
0
        public ActionResult Index(Kalkulacka kalkulacka)
        {
            if (ModelState.IsValid)
            {
                kalkulacka.Vypocitej();
            }

            return(View(kalkulacka));
        }
Esempio n. 3
0
        // GET: Kalkulacka
        public ActionResult Index()
        {
            Kalkulacka kalkulacka = new Kalkulacka();

            return(View(kalkulacka));
        }