private void btnTCKontol_Click(object sender, EventArgs e) { if (txtMusteriTC.Text == "") { txtMusteriTC.Text = "0"; } string queryTCKontrol = "select * from Musteriler where TCKimlikNo='" + txtMusteriTC.Text + "'"; SqlConnection cnnTCKontrol = new SqlConnection(connectionString); cnnTCKontrol.Open(); SqlCommand cmdTCKontrol = new SqlCommand(queryTCKontrol); cmdTCKontrol.Connection = cnnTCKontrol; SqlDataAdapter daTCKontrol = new SqlDataAdapter(queryTCKontrol, cnnTCKontrol); SqlDataReader drTCKontrol = cmdTCKontrol.ExecuteReader(); if (drTCKontrol.Read()) { MessageBox.Show("Müşteri Kayıtlı"); } else { MessageBox.Show("Yeni Müşteri"); this.Hide(); frmMusteriEkle frmMusteriEkle = new frmMusteriEkle(); frmMusteriEkle.Show(); GosterMusteriler(); } cnnTCKontrol.Close(); }
private void btnMusteriEkle_Click(object sender, EventArgs e) { frmMusteriEkle frmMusteriEkle = new frmMusteriEkle(); this.Hide(); frmMusteriEkle.Show(); }