private void cihazlar_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            string[] ads = cihazlar.Text.Split(' ');
            islemler.Items.Clear();
            FbConnection baglan  = new FbConnection(fk.Baglanti_Kodu());
            FbConnection baglan2 = new FbConnection(fk.Baglanti_Kodu());

            baglan.Open();
            FbCommand TkpNoSql = new FbCommand("SELECT * FROM Teknik_Takip WHERE Takip_id='" + ads[0] + "'", baglan);
            object    sonuc; FbDataReader TkpNoOku;

            sonuc = TkpNoSql.ExecuteScalar();
            if (sonuc != null)
            {
                TkpNoOku = TkpNoSql.ExecuteReader();
                TkpNoOku.Read();
                grup3.Enabled = true;
                id            = TkpNoOku["Takip_id"].ToString();
                if (int.Parse(TkpNoOku["Takip_durum"].ToString()) == 1)
                {
                    grup5.Enabled = true;
                }
                else
                {
                    grup5.Enabled = false;
                }
                cihazbilgi.Text = TkpNoOku["Takip_marka"].ToString() + " " + TkpNoOku["Takip_model"].ToString();
                this.Text       = cihazbilgi.Text;
                baglan2.Open();
                FbCommand TakipGunSqlSay = new FbCommand("SELECT COUNT(*) FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                object    say            = TakipGunSqlSay.ExecuteScalar();
                baglan2.Close();

                baglan2.Open();
                FbCommand TakipGunSql = new FbCommand("SELECT * FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                if (int.Parse(say.ToString()) > 0)
                {
                    FbDataReader TakipGunOku = TakipGunSql.ExecuteReader();
                    while (TakipGunOku.Read())
                    {
                        islemler.Items.Add(TakipGunOku["Takip_bilgi"].ToString());
                    }
                }
                else
                {
                    islemler.Items.Add("Bu cihazda şuanda işlem yapılmamıştır");
                }
                baglan2.Close();

                if (TkpNoOku["Takip_musteri"].ToString() != "")
                {
                    string mmid = TkpNoOku["Takip_musteri"].ToString();
                    baglan2.Open();
                    FbCommand    MusSql = new FbCommand("SELECT Musteri_adi,Musteri_soyadi,Musteri_telefon FROM Musteriler WHERE Musteri_id='" + mmid + "'", baglan2);
                    FbDataReader MusOku = MusSql.ExecuteReader();
                    MusOku.Read();
                    musadsoyad.Text = MusOku["Musteri_adi"].ToString() + " " + MusOku["Musteri_soyadi"].ToString();
                    mustel.Text     = MusOku["Musteri_telefon"].ToString();
                    baglan2.Close();
                }
                else
                {
                    musadsoyad.Text = TkpNoOku["Takip_kisibilgi"].ToString();
                    mustel.Text     = TkpNoOku["Takip_kisiTel"].ToString();
                }
            }
            else
            {
                MessageBox.Show("Takip bulunamadı ( Hata kodu: T-04 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            baglan.Close();
        }
        private void AraButton_Click(object sender, EventArgs e)
        {
            islemler.Items.Clear();
            FbConnection baglan  = new FbConnection(fk.Baglanti_Kodu());
            FbConnection baglan2 = new FbConnection(fk.Baglanti_Kodu());

            if (AramaText.Text != "")
            {
                if (TkpNo.Checked)
                {
                    baglan.Open();
                    FbCommand TkpNoSql = new FbCommand("SELECT * FROM Teknik_Takip WHERE Takip_no='" + AramaText.Text + "'", baglan);
                    object    sonuc; FbDataReader TkpNoOku;
                    sonuc = TkpNoSql.ExecuteScalar();
                    if (sonuc != null)
                    {
                        TkpNoOku = TkpNoSql.ExecuteReader();
                        TkpNoOku.Read();
                        grup3.Enabled = true;
                        grup2.Enabled = false;
                        id            = TkpNoOku["Takip_id"].ToString();
                        if (int.Parse(TkpNoOku["Takip_durum"].ToString()) == 1)
                        {
                            grup5.Enabled = true;
                        }
                        else
                        {
                            grup5.Enabled = false;
                        }
                        cihazbilgi.Text = TkpNoOku["Takip_marka"].ToString() + " " + TkpNoOku["Takip_model"].ToString();
                        this.Text       = cihazbilgi.Text;
                        baglan2.Open();
                        FbCommand TakipGunSqlSay = new FbCommand("SELECT COUNT(*) FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                        object    say            = TakipGunSqlSay.ExecuteScalar();
                        baglan2.Close();

                        baglan2.Open();
                        FbCommand TakipGunSql = new FbCommand("SELECT * FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                        if (int.Parse(say.ToString()) > 0)
                        {
                            FbDataReader TakipGunOku = TakipGunSql.ExecuteReader();
                            while (TakipGunOku.Read())
                            {
                                islemler.Items.Add(TakipGunOku["Takip_bilgi"].ToString());
                            }
                        }
                        else
                        {
                            islemler.Items.Add("Bu cihazda şuanda işlem yapılmamıştır");
                        }
                        baglan2.Close();

                        if (TkpNoOku["Takip_musteri"].ToString() != "")
                        {
                            baglan2.Open();
                            FbCommand    MusSql = new FbCommand("SELECT Musteri_adi,Musteri_soyadi,Musteri_telefon FROM Musteriler WHERE Musteri_id='" + TkpNoOku["Takip_musteri"].ToString() + "'", baglan2);
                            FbDataReader MusOku = MusSql.ExecuteReader();
                            MusOku.Read();
                            musadsoyad.Text = MusOku["Musteri_adi"].ToString() + " " + MusOku["Musteri_soyadi"].ToString();
                            mustel.Text     = MusOku["Musteri_telefon"].ToString();
                            baglan2.Close();
                        }
                        else
                        {
                            musadsoyad.Text = TkpNoOku["Takip_kisibilgi"].ToString();
                            mustel.Text     = TkpNoOku["Takip_kisiTel"].ToString();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Takip bulunamadı ( Hata kodu: T-04 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        grup3.Enabled = false;
                        grup2.Enabled = false;
                        cihazlar.Items.Clear();
                        islemler.Items.Clear();
                        cihazbilgi.Text  = "";
                        musadsoyad.Text  = "";
                        mustel.Text      = "";
                        guncelleme.Text  = "";
                        tkpKapat.Checked = false;
                        this.Text        = "Takip Güncelleme";
                    }
                    baglan.Close();
                }
                else if (İmeiNo.Checked)
                {
                    baglan.Open();
                    FbCommand TkpNoSql = new FbCommand("SELECT * FROM Teknik_Takip WHERE Takip_imei='" + AramaText.Text + "'", baglan);
                    object    sonuc; FbDataReader TkpNoOku;
                    sonuc = TkpNoSql.ExecuteScalar();
                    if (sonuc != null)
                    {
                        TkpNoOku = TkpNoSql.ExecuteReader();
                        TkpNoOku.Read();
                        grup3.Enabled = true;
                        grup2.Enabled = false;
                        id            = TkpNoOku["Takip_id"].ToString();
                        if (int.Parse(TkpNoOku["Takip_durum"].ToString()) == 1)
                        {
                            grup5.Enabled = true;
                        }
                        else
                        {
                            grup5.Enabled = false;
                        }
                        cihazbilgi.Text = TkpNoOku["Takip_marka"].ToString() + " " + TkpNoOku["Takip_model"].ToString();
                        this.Text       = cihazbilgi.Text;
                        baglan2.Open();
                        FbCommand TakipGunSqlSay = new FbCommand("SELECT COUNT(*) FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                        object    say            = TakipGunSqlSay.ExecuteScalar();
                        baglan2.Close();

                        baglan2.Open();
                        FbCommand TakipGunSql = new FbCommand("SELECT * FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                        if (int.Parse(say.ToString()) > 0)
                        {
                            FbDataReader TakipGunOku = TakipGunSql.ExecuteReader();
                            while (TakipGunOku.Read())
                            {
                                islemler.Items.Add(TakipGunOku["Takip_bilgi"].ToString());
                            }
                        }
                        else
                        {
                            islemler.Items.Add("Bu cihazda şuanda işlem yapılmamıştır");
                        }
                        baglan2.Close();

                        if (TkpNoOku["Takip_musteri"].ToString() != "")
                        {
                            baglan2.Open();
                            FbCommand    MusSql = new FbCommand("SELECT Musteri_adi,Musteri_soyadi,Musteri_telefon FROM Musteriler WHERE Musteri_id='" + TkpNoOku["Takip_musteri"].ToString() + "'", baglan2);
                            FbDataReader MusOku = MusSql.ExecuteReader();
                            MusOku.Read();
                            musadsoyad.Text = MusOku["Musteri_adi"].ToString() + " " + MusOku["Musteri_soyadi"].ToString();
                            mustel.Text     = MusOku["Musteri_telefon"].ToString();
                            baglan2.Close();
                        }
                        else
                        {
                            musadsoyad.Text = TkpNoOku["Takip_kisibilgi"].ToString();
                            mustel.Text     = TkpNoOku["Takip_kisiTel"].ToString();
                        }
                        baglan.Close();
                    }
                    else
                    {
                        MessageBox.Show("Takip bulunamadı ( Hata kodu: T-04 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        grup3.Enabled = false;
                        grup2.Enabled = false;
                        cihazlar.Items.Clear();
                        islemler.Items.Clear();
                        cihazbilgi.Text  = "";
                        musadsoyad.Text  = "";
                        mustel.Text      = "";
                        guncelleme.Text  = "";
                        tkpKapat.Checked = false; this.Text = "Takip Güncelleme";
                    }
                    baglan.Close();
                }
                else if (SeriNo.Checked)
                {
                    baglan.Open();
                    FbCommand TkpNoSql = new FbCommand("SELECT * FROM Teknik_Takip WHERE Takip_serino='" + AramaText.Text + "'", baglan);
                    object    sonuc; FbDataReader TkpNoOku;
                    sonuc = TkpNoSql.ExecuteScalar();
                    if (sonuc != null)
                    {
                        TkpNoOku = TkpNoSql.ExecuteReader();
                        TkpNoOku.Read();
                        grup2.Enabled = false;
                        id            = TkpNoOku["Takip_id"].ToString();
                        if (int.Parse(TkpNoOku["Takip_durum"].ToString()) == 1)
                        {
                            grup5.Enabled = true;
                        }
                        else
                        {
                            grup5.Enabled = false;
                        }
                        cihazbilgi.Text = TkpNoOku["Takip_marka"].ToString() + " " + TkpNoOku["Takip_model"].ToString();
                        this.Text       = cihazbilgi.Text;
                        baglan2.Open();
                        FbCommand TakipGunSqlSay = new FbCommand("SELECT COUNT(*) FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                        object    say            = TakipGunSqlSay.ExecuteScalar();
                        baglan2.Close();

                        baglan2.Open();
                        FbCommand TakipGunSql = new FbCommand("SELECT * FROM TeknikTakipIslemler WHERE Takip_id='" + id + "'", baglan2);
                        if (int.Parse(say.ToString()) > 0)
                        {
                            FbDataReader TakipGunOku = TakipGunSql.ExecuteReader();
                            while (TakipGunOku.Read())
                            {
                                islemler.Items.Add(TakipGunOku["Takip_bilgi"].ToString());
                            }
                        }
                        else
                        {
                            islemler.Items.Add("Bu cihazda şuanda işlem yapılmamıştır");
                        }
                        baglan2.Close();

                        if (TkpNoOku["Takip_musteri"].ToString() != "")
                        {
                            baglan2.Open();
                            FbCommand    MusSql = new FbCommand("SELECT Musteri_adi,Musteri_soyadi,Musteri_telefon FROM Musteriler WHERE Musteri_id='" + TkpNoOku["Takip_musteri"].ToString() + "'", baglan2);
                            FbDataReader MusOku = MusSql.ExecuteReader();
                            MusOku.Read();
                            musadsoyad.Text = MusOku["Musteri_adi"].ToString() + " " + MusOku["Musteri_soyadi"].ToString();
                            mustel.Text     = MusOku["Musteri_telefon"].ToString();
                            baglan2.Close();
                        }
                        else
                        {
                            musadsoyad.Text = TkpNoOku["Takip_kisibilgi"].ToString();
                            mustel.Text     = TkpNoOku["Takip_kisiTel"].ToString();
                        }
                        baglan.Close();
                    }
                    else
                    {
                        MessageBox.Show("Takip bulunamadı ( Hata kodu: T-04 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        grup3.Enabled = false;
                        grup2.Enabled = false;
                        cihazlar.Items.Clear();
                        islemler.Items.Clear();
                        cihazbilgi.Text  = "";
                        musadsoyad.Text  = "";
                        mustel.Text      = "";
                        guncelleme.Text  = "";
                        tkpKapat.Checked = false; this.Text = "Takip Güncelleme";
                    }
                    baglan.Close();
                }
                else if (AdveSoyad.Checked)
                {
                    baglan.Open();
                    FbCommand TkpNoSql = new FbCommand("SELECT * FROM Teknik_Takip WHERE Takip_kisibilgi like '%" + fk.IlkHarfleriBuyut(AramaText.Text) + "%' or Takip_musteri in ( SELECT Musteri_id FROM Musteriler WHERE Musteri_adi like '%" + fk.IlkHarfleriBuyut(AramaText.Text) + "%' or Musteri_soyadi like '%" + fk.IlkHarfleriBuyut(AramaText.Text) + "%')", baglan);
                    object    sonuc; FbDataReader TkpNoOku;
                    sonuc = TkpNoSql.ExecuteScalar();
                    if (sonuc != null)
                    {
                        TkpNoOku      = TkpNoSql.ExecuteReader();
                        grup2.Enabled = true;
                        cihazlar.Items.Clear();
                        while (TkpNoOku.Read())
                        {
                            cihazlar.Items.Add(TkpNoOku["Takip_id"].ToString() + " " + TkpNoOku["Takip_marka"].ToString() + " " + TkpNoOku["Takip_model"].ToString());
                        }
                        cihazlar.SelectedIndex = 0;
                    }
                    else
                    {
                        MessageBox.Show("Takip bulunamadı ( Hata kodu: T-04 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        grup3.Enabled = false;
                        islemler.Items.Clear();
                        cihazbilgi.Text  = "";
                        musadsoyad.Text  = "";
                        mustel.Text      = "";
                        guncelleme.Text  = "";
                        tkpKapat.Checked = false; this.Text = "Takip Güncelleme";
                    }
                    baglan.Close();
                }
            }
            else
            {
                MessageBox.Show("Lütfen veri giriniz ( Hata kodu: T-05 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }