Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text != "" && NameTxtBox.Text != "")                            //textboxlar doluysa
                {
                    universite.FakulteEkle(Convert.ToInt32(textBox1.Text), NameTxtBox.Text); //textboxlardan no ve ad alıp ekliyor.
                    textBox1.Clear();
                    NameTxtBox.Clear();
                }

                else
                {
                    throw new Exception();
                }
            }
            catch (FormatException)//format hatasını yakalar mesaj verir
            {
                MessageBox.Show("Girişte Format Hatası");
            }
            catch (Exception)
            {
                MessageBox.Show("Birşey giriniz");
            }
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text != "" && NameTxtBox.Text != "")
                {
                    universite.FakulteEkle(Convert.ToInt32(textBox1.Text), NameTxtBox.Text);
                    textBox1.Clear();
                    NameTxtBox.Clear();
                }

                else
                {
                    throw new Exception();
                }
            }
            catch (FormatException)
            {
                MessageBox.Show("Girişte Format Hatası");
            }
            catch (Exception)
            {
                MessageBox.Show("Birşey giriniz");
            }
        }