예제 #1
0
        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();
        }
예제 #2
0
        private void btnMusteriEkle_Click(object sender, EventArgs e)
        {
            frmMusteriEkle frmMusteriEkle = new frmMusteriEkle();

            this.Hide();
            frmMusteriEkle.Show();
        }