private bool deneme() { bool x = false;; baglan.Open(); SqlDataAdapter da = new SqlDataAdapter("Select *from KULLANICILAR", baglan); DataTable tablo = new DataTable(); da.Fill(tablo); for (int i = 0; i < tablo.Rows.Count; i++) { if (ykayitKullanıcıadiTextBox.Text == tablo.Rows[i]["KULLANICI_ADI"].ToString()) { uyarı uy = new uyarı(); uy.hata("Bu kullanıcı adı alınmış."); ykayitKullanıcıadiTextBox.Focus(); x = false; break; } else { x = true; } } baglan.Close(); return(x); }
private void ykayitKullanıcıadiTextBox_MouseClick(object sender, MouseEventArgs e) { if (textBox4.Text == String.Empty) { uyarı uy = new uyarı(); uy.hata("E-MAİL alanı boş bırakılamaz."); textBox4.Focus(); textBox4.ForeColor = Color.FromArgb(78, 184, 206); panel4.BackColor = Color.FromArgb(78, 184, 206); textBox1.ForeColor = Color.WhiteSmoke; panel1.BackColor = Color.WhiteSmoke; textBox2.ForeColor = Color.WhiteSmoke; panel2.BackColor = Color.WhiteSmoke; textBox3.ForeColor = Color.WhiteSmoke; panel3.BackColor = Color.WhiteSmoke; textBox6.ForeColor = Color.WhiteSmoke; panel6.BackColor = Color.WhiteSmoke; textBox5.ForeColor = Color.WhiteSmoke; panel5.BackColor = Color.WhiteSmoke; return; } textBox5.ForeColor = Color.FromArgb(78, 184, 206); panel5.BackColor = Color.FromArgb(78, 184, 206); textBox1.ForeColor = Color.WhiteSmoke; panel1.BackColor = Color.WhiteSmoke; textBox2.ForeColor = Color.WhiteSmoke; panel2.BackColor = Color.WhiteSmoke; textBox3.ForeColor = Color.WhiteSmoke; panel3.BackColor = Color.WhiteSmoke; textBox4.ForeColor = Color.WhiteSmoke; panel4.BackColor = Color.WhiteSmoke; textBox6.ForeColor = Color.WhiteSmoke; panel6.BackColor = Color.WhiteSmoke; }
private void girisyap() { baglan.Open(); SqlCommand komut = new SqlCommand("Select *from KULLANICILAR", baglan); SqlDataReader oku = komut.ExecuteReader(); uyarı uy = new uyarı(); while (oku.Read()) { if (kullaniciadiTextBox.Text == oku["KULLANICI_ADI"].ToString() && sifreTextBox.Text == oku["ŞİFRE"].ToString() && oku["ROL_ID"].ToString() == "0") { uyepanel yp = new uyepanel(); uy.l.Text = "Giriş Başarılı!"; uy.basariliuye(); uyepanel up = new uyepanel(); up.Show(); this.Close(); baglan.Close(); return; } } uy.hata("Hatalı giriş yaptınız!"); uyegiris ug = new uyegiris(); ug.Show(); baglan.Close(); }
private void kaydet_button_Click(object sender, EventArgs e) { if (ykayitTcTextBox.Text != string.Empty && ykayitAdTextBox.Text != string.Empty && ykayitSoyadTextBox.Text != string.Empty && ykayitEmailTextBox.Text != string.Empty && ykayitKullanıcıadiTextBox.Text != string.Empty && ykayitSifreTextBox.Text != string.Empty && deneme() ) { baglan.Open(); SqlCommand komut = new SqlCommand("insert into KULLANICILAR(TC,AD,SOYAD,EMAİL,KULLANICI_ADI,ŞİFRE) values ('" + ykayitTcTextBox.Text.ToString() + "','" + ykayitAdTextBox.Text.ToString() + "','" + ykayitSoyadTextBox.Text.ToString() + "','" + ykayitEmailTextBox.Text.ToString() + "','" + ykayitKullanıcıadiTextBox.Text.ToString() + "','" + ykayitSifreTextBox.Text.ToString() + "')", baglan); komut.ExecuteNonQuery(); baglan.Close(); ykayitTcTextBox.Clear(); ykayitAdTextBox.Clear(); ykayitSoyadTextBox.Clear(); ykayitEmailTextBox.Clear(); ykayitKullanıcıadiTextBox.Clear(); ykayitSifreTextBox.Clear(); return; } else if (ykayitTcTextBox.Text == string.Empty || ykayitAdTextBox.Text == string.Empty || ykayitSoyadTextBox.Text == string.Empty || ykayitEmailTextBox.Text == string.Empty || ykayitKullanıcıadiTextBox.Text == string.Empty || ykayitSifreTextBox.Text == string.Empty ) { uyarı uy = new uyarı(); uy.hata("Boş alanları doldurunuz!"); } baglan.Close(); }
private bool deneme() { bool x = false;; baglan.Open(); SqlDataAdapter da = new SqlDataAdapter("Select *from KITAPLAR", baglan); DataTable tablo = new DataTable(); da.Fill(tablo); for (int i = 0; i < tablo.Rows.Count; i++) { if (ykayitKitapnoBox == tablo.Rows[i]["KITAP_ID"]) { uyarı uy = new uyarı(); uy.hata("Bu kitap kayıtlı."); // MessageBox.Show("Bu kitap kayıtlı."); x = false; break; } else { x = true; } } baglan.Close(); return(x); }
private void kaydet_button_Click(object sender, EventArgs e) { if (ykayitKitapnoBox.Text != string.Empty && ykayitKitapadextBox.Text != string.Empty && ykayitYazarTextBox.Text != string.Empty && ykayitYayıneviTextBox.Text != string.Empty && ykayitSayfaTextBox.Text != string.Empty && deneme() ) { baglan.Open(); SqlCommand komut = new SqlCommand("insert into KITAPLAR(KITAP_ID,KITAP_ADI,YAZAR,YAYINEVİ,SAYFA) values ('" + ykayitKitapnoBox.Text.ToString() + "','" + ykayitKitapadextBox.Text.ToString() + "','" + ykayitYazarTextBox.Text.ToString() + "','" + ykayitYayıneviTextBox.Text.ToString() + "','" + ykayitSayfaTextBox.Text.ToString() + "')", baglan); komut.ExecuteNonQuery(); baglan.Close(); ykayitKitapnoBox.Clear(); ykayitKitapadextBox.Clear(); ykayitYazarTextBox.Clear(); ykayitYayıneviTextBox.Clear(); ykayitSayfaTextBox.Clear(); return; } else if (ykayitKitapnoBox.Text == string.Empty || ykayitKitapadextBox.Text == string.Empty || ykayitYazarTextBox.Text == string.Empty || ykayitYayıneviTextBox.Text == string.Empty || ykayitSayfaTextBox.Text == string.Empty) { uyarı uy = new uyarı(); uy.hata("Boş alanları doldurunuz!"); //MessageBox.Show("Boş alanları doldurunuz!", "HATA!"); } baglan.Close(); }
private void giris_button_Click(object sender, EventArgs e) { if (sifreTextBox.Text == String.Empty) { this.Close(); uyarı uy = new uyarı(); uy.hata("Alanlardan birini boş bıraktınız!"); return; } girisyap(); //this.Close(); }
private void giris_button_Click(object sender, EventArgs e) { if (sifreTextBox.Text == String.Empty) { uyarı uy = new uyarı(); uy.hata("Alanlardan birini boş bıraktınız!"); return; } girisyap(); this.Close(); pictureBox1.BackgroundImage = Properties.Resources.unnamed; panel2.BackColor = Color.WhiteSmoke; kullaniciadiTextBox.ForeColor = Color.WhiteSmoke; pictureBox2.BackgroundImage = Properties.Resources.password_2; panel3.BackColor = Color.WhiteSmoke; sifreTextBox.ForeColor = Color.WhiteSmoke; }
private void ykayitSayfaTextBox_MouseClick(object sender, MouseEventArgs e) { if (ykayitYayıneviTextBox.Text == String.Empty) { uyarı uy = new uyarı(); uy.hata("Yayınevi alanı boş bırakılamaz."); ykayitKitapnoBox.Focus(); return; } ykayitSayfaTextBox.ForeColor = Color.FromArgb(78, 184, 206); panel14.BackColor = Color.FromArgb(78, 184, 206); ykayitKitapnoBox.ForeColor = Color.WhiteSmoke; panel10.BackColor = Color.WhiteSmoke; ykayitKitapadextBox.ForeColor = Color.WhiteSmoke; panel11.BackColor = Color.WhiteSmoke; ykayitYazarTextBox.ForeColor = Color.WhiteSmoke; panel12.BackColor = Color.WhiteSmoke; ykayitYayıneviTextBox.ForeColor = Color.WhiteSmoke; panel13.BackColor = Color.WhiteSmoke; }
private void ykayitSifreTextBox_MouseClick(object sender, MouseEventArgs e) { if (ykayitKullanıcıadiTextBox.Text == String.Empty) { uyarı uy = new uyarı(); uy.hata("KULLANICI ADI alanı boş bırakılamaz."); ykayitKullanıcıadiTextBox.Focus(); return; } ykayitSifreTextBox.ForeColor = Color.FromArgb(78, 184, 206); panel15.BackColor = Color.FromArgb(78, 184, 206); ykayitTcTextBox.ForeColor = Color.WhiteSmoke; panel10.BackColor = Color.WhiteSmoke; ykayitAdTextBox.ForeColor = Color.WhiteSmoke; panel11.BackColor = Color.WhiteSmoke; ykayitSoyadTextBox.ForeColor = Color.WhiteSmoke; panel12.BackColor = Color.WhiteSmoke; ykayitEmailTextBox.ForeColor = Color.WhiteSmoke; panel13.BackColor = Color.WhiteSmoke; ykayitKullanıcıadiTextBox.ForeColor = Color.WhiteSmoke; panel14.BackColor = Color.WhiteSmoke; }
private void sifreTextBox_MouseClick(object sender, MouseEventArgs e) { pictureBox2.BackgroundImage = Properties.Resources.password_move; panel3.BackColor = Color.FromArgb(78, 184, 206); sifreTextBox.ForeColor = Color.FromArgb(78, 184, 206); pictureBox1.BackgroundImage = Properties.Resources.User_icon_BLACK_011; panel2.BackColor = Color.WhiteSmoke; kullaniciadiTextBox.ForeColor = Color.WhiteSmoke; if (kullaniciadiTextBox.Text == String.Empty || kullaniciadiTextBox.Text == "Kullanıcı Adı") { uyarı uy = new uyarı(); uy.hata("Kullanıcı Adı alanı boş bırakılamaz."); kullaniciadiTextBox.Focus(); pictureBox1.BackgroundImage = Properties.Resources.user_move; panel2.BackColor = Color.FromArgb(78, 184, 206); kullaniciadiTextBox.ForeColor = Color.FromArgb(78, 184, 206); pictureBox2.BackgroundImage = Properties.Resources.password_21; panel3.BackColor = Color.WhiteSmoke; sifreTextBox.ForeColor = Color.WhiteSmoke; return; } }