private void btnGiris_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtTcNo.Text) && !string.IsNullOrEmpty(txtSifre.Text)) { connect.Open(); command = new SqlCommand("Select * From tblKullanicilar where kullaniciTcNo = @p1 and kullaniciSifre = @p2", connect); command.Parameters.AddWithValue("@p1", txtTcNo.Text); command.Parameters.AddWithValue("@p2", txtSifre.Text); read = command.ExecuteReader(); if (read.Read()) { if (read[4].Equals(1)) { this.Hide(); FormPersonel formPersonel = new FormPersonel(); formPersonel.Show(); } else if (read[4].Equals(2)) { this.Hide(); FormYonetici formYonetici = new FormYonetici(); formYonetici.Show(); } } else { MessageBox.Show("Kullanıcı Adı veya Şifre Hatalıdır. Tekrar Deneyiniz"); } connect.Close(); } else { MessageBox.Show("Lütfen Kullanıcı Adını ve Şifre Giriniz."); } }
private void pictureBox1_Click(object sender, EventArgs e) { this.Hide(); FormYonetici fr = new FormYonetici(); fr.Show(); }