示例#1
0
        private void btn_Uye_ol_Click(object sender, EventArgs e)
        {
            Uye_Ol UyeFormu = new Uye_Ol();

            UyeFormu.Show();
            this.Hide();
        }
        private void btn_Guncelle_Click(object sender, EventArgs e)
        {
            /* Mail_adresi_kontrol = string.Compare(Mail_Adresi, txt_Mailadresi.Text);
             * Telefonnumarasi_kontrol = string.Compare(Telefon_Numarasi, txt_Telefonnumarasi.Text);
             * Sifre_kontrol = string.Compare(Sifre, txt_Sifre.Text);*/
            /// Mail_adresi_kontrol = string.Compare()
            Uye_Ol Uye_Ol_Formu = new Uye_Ol();

            //if (TcDogruMu(txt_Kullanici_idi_Sorgu))
            if (TcDogruMu(txt_Kullanici_idi_Sorgu))
            {
                if (kullanici_mail.ToString() != txt_Kullanici_Mail.Text)
                {
                    if (Uye_Ol_Formu.Mail_Kont(txt_Kullanici_Mail))
                    {
                        baglanti.Open();
                        komut = new SqlCommand("update Kullanici_Bilgi set mail_adresi= '" + txt_Kullanici_Mail.Text + "' where Id_numarasi='" + txt_Kullanici_idi_Sorgu.Text + "'", baglanti);
                        komut.ExecuteNonQuery();
                        baglanti.Close();
                    }
                    else
                    {
                        MessageBox.Show("Girdiginiz ifadenin mail olmasi gereklidir");
                    }
                }
                if (kullanici_tel.ToString() != txt_Kullanici_Tel.Text)
                {
                    if (Uye_Ol_Formu.Telefon_Kontrol(txt_Kullanici_Tel))
                    {
                        baglanti.Open();
                        komut = new SqlCommand("update Kullanici_Bilgi set telefon_numarasi= '" + txt_Kullanici_Tel.Text + "' where Id_numarasi='" + txt_Kullanici_idi_Sorgu.Text + "'", baglanti);
                        komut.ExecuteNonQuery();
                        baglanti.Close();
                    }
                    else
                    {
                        MessageBox.Show("Girdiginz ifade 9 haneli telfon numarasi olmalidir ");
                    }
                }
            }
        }
        private void btn_Gorevli_Ekle_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut4 = new SqlCommand("select Yonetici_Idsi from Yoneticilerin_Bilgisi where Id_Numarasi = " + txt_Yon_Idi.Text + "", baglanti);

            if (Convert.ToInt32(komut4.ExecuteScalar()) == 0)
            {
                baglanti.Close();
                Uye_Ol Uye_Ol_Formu = new Uye_Ol();
                string sorgu        = "insert into Yoneticilerin_Bilgisi(Adi, Soyadi, Id_Numarasi, Dogum_Tarihi, Egitim_Durumu, Mail_Adresi, Telefon_Numarasi, Sifre) values (@p1,@p2,@p3,@p4,@p5,@p6,@p7,@p8)";
                if (TcDogruMu(txt_Yon_Idi))
                {
                    if (Uye_Ol_Formu.Mail_Kont(txt_Yon_Mail) && Uye_Ol_Formu.Telefon_Kontrol(txt_Yon_Tel_No))
                    {
                        if (txt_Yon_Tel_No.TextLength >= 6)
                        {
                            try
                            {
                                Uye_Ol_Formu.Yeni_Kullanici(sorgu, txt_Yon_Adi, txt_Yon_Soyadi, txt_Yon_Idi, dtp_Yon_Dogum_Tarihi, rdb_Lise, txt_Yon_Mail, txt_Yon_Tel_No, txt_Yon_Sifre, txt_Yon_Sifre_Tekrar);
                            }
                            catch
                            {
                                MessageBox.Show("Islem yapoilirken bir hata olustu. \n  Butun bilgilerin doldurulmus oldugundan emin olunuz!! ");
                            }
                        }
                        else
                        {
                            MessageBox.Show("Sifreniz en az 6 karakter olmalidir!!", "uyari", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
            else
            {
                baglanti.Close();
                MessageBox.Show("lutfen TC nizi kontrol ediniz! ");
            }
        }
        private void btn_grp_box_Guncelle_Click(object sender, EventArgs e)
        {
            int Mail_adresi_kontrol, Telefonnumarasi_kontrol, Sifre_kontrol;

            Mail_adresi_kontrol     = string.Compare(Mail_Adresi, txt_Mailadresi.Text);
            Telefonnumarasi_kontrol = string.Compare(Telefon_Numarasi, txt_Telefonnumarasi.Text);
            Sifre_kontrol           = string.Compare(Sifre, txt_Sifre.Text);
            Uye_Ol uye_OL_FOrmu = new Uye_Ol();

            ////// mail kklontol EKLEEEEEEEEEEEEEEEEEEEEEe
            if (!(Mail_adresi_kontrol == 0))
            {
                if (uye_OL_FOrmu.Mail_Kont(txt_Mailadresi))
                {
                    baglanti.Open();
                    komut             = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandText = "update Kullanici_Bilgi set Mail_adresi='" + txt_Mailadresi.Text + "' where Kullanici_Idsi ='" + _userId + "'";
                    oku = komut.ExecuteReader();


                    baglanti.Close();
                    oku.Close();
                }
            }

            if (!(Telefonnumarasi_kontrol == 0))
            {
                if (uye_OL_FOrmu.Telefon_Kontrol(txt_Telefonnumarasi))
                {
                    baglanti.Open();
                    komut             = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandText = "update Kullanici_Bilgi set telefon_numarasi='" + txt_Telefonnumarasi.Text + "' where Kullanici_Idsi ='" + _userId + "'";
                    oku = komut.ExecuteReader();
                    MessageBox.Show("hadi bakim numara degisti ");
                    baglanti.Close();
                }
            }

            if (!(Sifre_kontrol == 0))
            {
                if (txt_Sifre.Text == txt_Sifre_Tekrar.Text)
                {
                    baglanti.Open();
                    komut             = new SqlCommand();
                    komut.Connection  = baglanti;
                    komut.CommandText = "update Kullanici_Bilgi set sifre='" + txt_Sifre.Text + "' where Kullanici_Idsi ='" + _userId + "'";
                    oku = komut.ExecuteReader();
                    oku.Close();
                    baglanti.Close();


                    MessageBox.Show("hadi bakim sifre degisti ");
                }
                else
                {
                    MessageBox.Show("Sifreler uyusmuyor!", "hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }