//Şifreleme Bitiş private void b_kayit_Click(object sender, EventArgs e) { flag1 = 0; flag2 = 0; if (t_sifre.Text == t_sifre_t.Text && t_ad.Text != "" && t_mail.Text != "") { foreach (DataGridViewRow dr in dgvKullanici.Rows) { if (dr.Cells["ad"].Value.ToString() == t_ad.Text) { flag1 = 1; } if (dr.Cells["mail"].Value.ToString() == t_mail.Text) { flag2 = 1; } } if (flag1 == 0 && flag2 == 0) { MSSQLVeritabani sql = new MSSQLVeritabani(); sql.kullanici_ekle(t_ad.Text, SHA256(t_sifre.Text), t_mail.Text); MessageBox.Show("Kayıt Başarılı"); this.Close(); } else if (flag1 == 1 && flag2 == 1) { MessageBox.Show("Bu kullanıcı adı ve mail adresi sistemimize kayıtlı"); } else if (flag1 == 1 && flag2 == 0) { MessageBox.Show("Bu kullanıcı adı sistemimize kayıtlı"); } else { MessageBox.Show("Bu mail adresi sistemimize kayıtlı"); } } else { MessageBox.Show("Şifreler aynı değil veya bir giriş alanı boş bırakılmış"); } }
//Şifreleme Bitiş private void b_giris_Click(object sender, EventArgs e) { MSSQLVeritabani sql = new MSSQLVeritabani(); arraylist = sql.kullanici_goster(t_ad.Text, SHA256(t_sifre.Text)); id = Convert.ToInt32(arraylist[0]); if (id != 0) { ad = arraylist[1].ToString(); mail = arraylist[2].ToString(); id_dondur(); ad_dondur(); mail_dondur(); this.Close(); } else { MessageBox.Show("Kullanıcı adı veya şifre hatalı"); } }
private void Kayit_Load(object sender, EventArgs e) { MSSQLVeritabani sql = new MSSQLVeritabani(); dgvKullanici.DataSource = sql.kullanicilar_goster(); }