示例#1
0
        private void LinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Kayıt kayıt = new Kayıt();

            kayıt.Show();

            Giriş grş = new Giriş();

            grş.Close();
            this.Hide();
        }
示例#2
0
        private void Giriş_Click(object sender, EventArgs e)
        {
            DateTime thisDate       = DateTime.Today;
            int      userprivilages = 0;

            baglanti.Open();
            SqlCommand komut3 = new SqlCommand();

            komut3.Connection = baglanti;

            komut3.CommandText = "Select kullanici_email From kullanicilar  where kullanici_email=@P2";
            komut3.Parameters.AddWithValue("@P2", mailtxt.Text);
            object Kontrol1 = komut3.ExecuteScalar();

            komut3.Parameters.Clear();
            baglanti.Close();

            baglanti.Open();
            SqlCommand komut2 = new SqlCommand();

            komut2.Connection = baglanti;

            komut2.CommandText = "Select kullanici_adi From kullanicilar  where kullanici_adi=@P1";
            komut2.Parameters.AddWithValue("@P1", kullanıcıadıtxt.Text);
            object Kontrol = komut2.ExecuteScalar();

            komut2.Parameters.Clear();

            baglanti.Close();



            baglanti.Open();
            SqlCommand komut4 = new SqlCommand();

            komut4.Connection = baglanti;

            komut4.CommandText = "Select kullanici_kulup From kullanicilar  where kullanici_kulup=@P5";
            komut4.Parameters.AddWithValue("@P5", kulüptxt.Text);
            object Kontrol2 = komut4.ExecuteScalar();

            komut4.Parameters.Clear();
            baglanti.Close();

            if (Kontrol1 != null)
            {
                emaillbl.Text = "Böyle bir mail var!";
            }

            else if (Kontrol != null)
            {
                kullanıcıhatalbl.Text = "Böyle bir kullanıcı var! ";
            }

            else if (Kontrol2 != null)
            {
                kuluphatalbl.Text = "Böyle bir kulüp bulunmaktadır!";
            }

            else if (kullanıcıadıtxt.Text.Trim() == string.Empty || sifretxt.Text.Trim() == string.Empty || sifretekrar.Text.Trim() == string.Empty || kulüptxt.Text.Trim() == string.Empty || mailtxt.Text.Trim() == string.Empty)
            {
                label5.Text = "Eksik Bilgiler Girildi.";
                return;
            }
            else if (kullanıcıadıtxt.Text.Length == 15 || sifretxt.Text.Length < 5 || sifretekrar.Text.Length < 5)
            {
            }
            else if (sifretxt.Text != sifretekrar.Text)
            {
                sifrehatalbl.Text = "Şifreler uyuşmuyor";
            }

            else
            {
                baglanti.Open();
                SqlCommand komut = new SqlCommand("insert into kullanicilar(kullanici_adi,kullanici_sifre" +
                                                  ",kullanici_kulup,kullanici_email,kullanici_tipi,kullanici_kayitTarih,kullanici_kurulusTarih)values" +
                                                  "(@P1,@P2,@P3,@P4,@P5,@P6,@P7)", baglanti);
                komut.Parameters.AddWithValue("@P1", kullanıcıadıtxt.Text);
                komut.Parameters.AddWithValue("@P2", sifretxt.Text);
                komut.Parameters.AddWithValue("@P3", kulüptxt.Text);
                komut.Parameters.AddWithValue("@P4", mailtxt.Text);
                komut.Parameters.AddWithValue("@P5", userprivilages);
                komut.Parameters.AddWithValue("@P6", thisDate);
                komut.Parameters.AddWithValue("@P7", dateTimePicker1.Value);
                komut.ExecuteNonQuery();
                baglanti.Close();

                Giriş grş = new Giriş();
                grş.Show();
                Kayıt k1 = new Kayıt();
                k1.Close();

                this.Hide();
            }
        }