private void textBox1_TextChanged(object sender, EventArgs e) { textBox2.Text = ""; if (String.IsNullOrEmpty(textBox1.Text)) { } else { str = @"Select AdSoyad from Ogrenci_Kaydi where No Like '%" + textBox1.Text + "%'"; if (DBLayer.TabloSorgula(str).Rows.Count > 0) { textBox2.Text = DBLayer.FunctionÇağır(str).ToString(); } } }
private void textBox3_TextChanged(object sender, EventArgs e) { textBox4.Text = ""; if (String.IsNullOrEmpty(textBox3.Text)) { } else { str = @"SELECT DersAdi FROM Ders_Bilgi WHERE DersNo LIKE '%" + textBox3.Text + "%'"; if (DBLayer.TabloSorgula(str).Rows.Count > 0) { textBox4.Text = DBLayer.FunctionÇağır(str).ToString(); } } }
private void btn_Kaydet_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(textBox2.Text) || String.IsNullOrEmpty(textBox3.Text)) { //MessageBox.Show("Alanlar boş bırakılamaz!", "Uyarı"); } else { string str = @"SELECT ID FROM Kullanici_Kaydi WHERE Email='" + textBox2.Text.ToString() + "'"; if (DBLayer.TabloSorgula(str).Rows.Count > 0) { string ID = DBLayer.FunctionÇağır(str).ToString(); str = @"UPDATE Kullanici_Kaydi SET Email = '" + textBox2.Text.ToString() + @"' , Sifre = '" + HashLayer.SHA512(textBox3.Text.ToString()) + @"' WHERE ID = '" + ID.ToString() + "' "; DBLayer.IslemYap(str); str = "Select *from Kullanici_Kaydi"; dataGridView1.DataSource = DBLayer.TabloSorgula(str); textBox1.Text = ""; textBox2.Text = ""; ID = "0"; } else { str = @"INSERT INTO Kullanici_Kaydi (Email,Sifre) Values('" + textBox2.Text.ToString() + @"', '" + HashLayer.SHA512(textBox3.Text.ToString()) + "')"; DBLayer.IslemYap(str); str = "Select *from Kullanici_Kaydi"; dataGridView1.DataSource = DBLayer.TabloSorgula(str); textBox1.Text = ""; textBox2.Text = ""; } } }