Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Giris uye = new Giris();

            uye.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            bagla.Open();
            try
            {
                if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == "")
                {
                    MessageBox.Show("Lütfen Bilgilerinizi Eksiksiz Giriniz..!"); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = "";
                    textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = "";
                }
                else
                {
                    string     sorgu1 = "select count(*) from Kullanici where kadi=@kadi or email=@mail";
                    SqlCommand esas1  = new SqlCommand(sorgu1, bagla);
                    esas1.Parameters.AddWithValue("@kadi", textBox3.Text);
                    esas1.Parameters.AddWithValue("@mail", textBox5.Text);
                    Int32 count = (Int32)esas1.ExecuteScalar();
                    if (count > 0)
                    {
                        MessageBox.Show("Belirtilen Kullanıcı Adı veya E-mail Daha Öncede Kullanılmış..!");
                        textBox1.Text = "";
                        textBox2.Text = "";
                        textBox3.Text = "";
                        textBox4.Text = "";
                        textBox5.Text = "";
                        textBox6.Text = "";
                    }
                    else
                    {
                        string s, st;
                        s  = textBox5.Text;
                        st = textBox6.Text;
                        if (s == st)
                        {
                            string kayit = "insert into Kullanici(ad,soyad,kadi,sifre,email) values (@ad,@soyad,@kadi,@sifre,@mail)";

                            SqlCommand komut = new SqlCommand(kayit, bagla);
                            komut.Parameters.AddWithValue("@ad", textBox1.Text);
                            komut.Parameters.AddWithValue("@soyad", textBox2.Text);
                            komut.Parameters.AddWithValue("@kadi", textBox3.Text);
                            komut.Parameters.AddWithValue("@mail", textBox4.Text);
                            komut.Parameters.AddWithValue("@sifre", textBox5.Text);
                            komut.ExecuteNonQuery();
                            MessageBox.Show("Kayıt Başarıyla Gerçekleştirildi..!");
                            Giris gec = new Giris();
                            gec.Show();
                            this.Close();
                        }
                    }
                }
            }

            catch (Exception hata)
            {
                MessageBox.Show("HATA" + hata);
            }
            bagla.Close();
        }
Ejemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
         {
             MessageBox.Show("Lütfen Bilgilerinizi Eksiksiz Giriniz..!");
             textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = "";
         }
         else
         {
             if (textBox4.Text == label4.Text)
             {
                 bagla.Open();
                 SqlCommand loginName = new SqlCommand("SELECT count(*) FROM Kullanici WHERE kadi=@kadi AND email=@mail", bagla);
                 loginName.Parameters.AddWithValue("@kadi", textBox1.Text);
                 loginName.Parameters.AddWithValue("@mail", textBox2.Text);
                 Int32 count = (Int32)loginName.ExecuteScalar();
                 bagla.Close();
                 if (count > 0)
                 {
                     bagla.Open();
                     string     guncelle = "Update Kullanici Set sifre=@newpass Where kadi=@kadi And email=@mail";
                     SqlCommand update   = new SqlCommand(guncelle, bagla);
                     update.Parameters.AddWithValue("@kadi", textBox1.Text);
                     update.Parameters.AddWithValue("@mail", textBox2.Text);
                     update.Parameters.AddWithValue("@newpass", textBox3.Text);
                     update.ExecuteNonQuery();
                     bagla.Close();
                     MessageBox.Show("Şifreniz Başarıyla Değiştirildi");
                     this.Close();
                     Giris gec = new Giris();
                     gec.Show();
                 }
                 else
                 {
                     MessageBox.Show("Lütfen Bilgilerinizi Doğru Girdiğinizden Emin Olun..!");
                 }
             }
             else
             {
                 MessageBox.Show("Lütfen Doğrulama Kodunu Doğru Girdiğinizden Emin Olun");
             }
         }
     }
     catch (Exception hata)
     {
         MessageBox.Show("Başarısız" + hata);
     }
 }