コード例 #1
0
        private void UyeKayıtKaydetButon_Click(object sender, EventArgs e)
        {
            try
            {
                baglanti.Open();
                String kayit = "insert into UyeBilgi(UyeAd,UyeSoyad,UyeDogumTarih,UyeTelefon,UyeEposta," +
                               "UyeAdresMahalle,UyeAdresSokakAdNo,UyeAdresApartmanAdNo,UyeAdresDaireNo,UyeParola," +
                               "UyeGuvenlikSoru,UyeGuvenlikYanıt,KartUstundekiAd,KartNumara,CvcKod) Values(@ad,@soyad,@dogumtarih,@telefon,@eposta," +
                               "@adresmahalle,@adressokak,@adresapartman,@adresdaire,@parola,@guvenliksoru,@guvenlikyanit,@KartUstuAd,@KartNo,@cvckodu)";

                SqlCommand komut = new SqlCommand(kayit, baglanti);

                komut.Parameters.AddWithValue("@ad", AdTextBox.Text);
                komut.Parameters.AddWithValue("@soyad", SoyadTextBox.Text);
                komut.Parameters.AddWithValue("@dogumtarih", DogumTarihTextBox.Text);
                komut.Parameters.AddWithValue("@telefon", TelefonTextBox.Text);
                komut.Parameters.AddWithValue("@eposta", EpostaTextBox.Text);
                komut.Parameters.AddWithValue("@adresmahalle", MahalleListBox.Text);
                komut.Parameters.AddWithValue("@adressokak", SokakNoAdTextBox.Text);
                komut.Parameters.AddWithValue("@adresapartman", ApartmanNoAdTextBox.Text);
                komut.Parameters.AddWithValue("@adresdaire", DaireNoTextBox.Text);
                komut.Parameters.AddWithValue("@parola", ParolaTextBox.Text);
                komut.Parameters.AddWithValue("@guvenliksoru", GuvenlikSoruTextBox.Text);
                komut.Parameters.AddWithValue("@guvenlikyanit", GuvenlikYanıtTextBox.Text);
                komut.Parameters.AddWithValue("@KartUstuAd", KartUstuAdTextbox.Text);
                komut.Parameters.AddWithValue("@KartNo", KartNumarasıTextBox.Text);
                komut.Parameters.AddWithValue("@cvckodu", CvcKodTextBox.Text);

                komut.ExecuteNonQuery();
                baglanti.Close();



                MessageBox.Show("Kayıt işlemniz tamamlandı. Ana Menüye dönerek sisteme giriş yapabilirsiniz");

                AdTextBox.Text            = "Örnek; Samet";
                SoyadTextBox.Text         = "Örnek; Yılmaz";
                DogumTarihTextBox.Text    = "Örnek; 1994-08-27";
                TelefonTextBox.Text       = "Örnek; 05447258236";
                EpostaTextBox.Text        = "Örnek; [email protected]";
                ParolaTextBox.Text        = "En Fazla 10 Karakter Giriniz";
                SokakNoAdTextBox.Text     = "Örnek; 1017";
                ApartmanNoAdTextBox.Text  = "Örnek; 49";
                DaireNoTextBox.Text       = "Örnek; 9";
                GuvenlikSoruTextBox.Text  = "";
                GuvenlikYanıtTextBox.Text = "";
                KartUstuAdTextbox.Text    = "";
                KartNumarasıTextBox.Text  = "";
                CvcKodTextBox.Text        = "";
            }
            catch (Exception hata)
            {
                UyeKayıtEkran uyekayitekran = new UyeKayıtEkran();
                uyekayitekran.BackColor = Color.Red;
                MessageBox.Show("İşlem sırasında bir hata oluştu", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                uyekayitekran.BackColor = Color.SeaGreen;
            }
        }
コード例 #2
0
 private void UyeKayıtButon_Click(object sender, EventArgs e)
 {
     Formlar.UyeKayıtEkran UyeKayıtSayfa = new Formlar.UyeKayıtEkran();
     UyeKayıtSayfa.Show();
     this.Hide();
 }