private void CihazBGuncelle_Click(object sender, EventArgs e)
 {
     if (marka.Text != "" && model.Text != "" && (imei.Text != "" || serino.Text != ""))
     {
         byte sonuc;
         sonuc = fk.Guncelle("Teknik_Takip", "Takip_marka='" + fk.IlkHarfleriBuyut(marka.Text) + "', Takip_model='" + fk.IlkHarfleriBuyut(model.Text) + "', Takip_imei='" + imei.Text + "', Takip_serino='" + serino.Text + "'", "Takip_no='" + label8.Text + "'");
         if (sonuc == 1)
         {
             MessageBox.Show("Cihaz bilgileri başarıyla güncellenmiştir", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
             Tkp.GridGuncelle();
             if (Tkp.takipno.Text != "TKP")
             {
                 Tkp.TakipArama();
             }
             else
             {
                 Tkp.FormLoad();
             }
         }
         else
         {
             MessageBox.Show("Cihaz bilgileri güncellenemedi ( Hata kodu: T-10 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Cihaz bilgilerini eksiksiz doldurunuz. ( Hata kodu: T-09 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
        private void Evet_Click(object sender, EventArgs e)
        {
            string       id = "";
            FbConnection b1 = new FbConnection(fk.Baglanti_Kodu());

            b1.Open();
            FbCommand TakipDetay = new FbCommand("SELECT TAKIP_ID FROM TEKNIK_TAKIP WHERE TAKIP_NO='" + label8.Text + "'", b1);
            object    s          = TakipDetay.ExecuteScalar();

            if (s != null)
            {
                FbDataReader idOku = TakipDetay.ExecuteReader(); idOku.Read();
                id = idOku["TAKIP_ID"].ToString(); idOku.Close();
            }
            else
            {
                MessageBox.Show("Sistemsel bir hata oluştu, lütfen sağlayacınıza başvurunuz.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            b1.Close();

            if (id != "")
            {
                b1.Open();
                FbCommand Detaylar = new FbCommand("SELECT * FROM TEKNIKTAKIPISLEMLER WHERE TAKIP_ID='" + id + "'", b1);
                object    s1       = TakipDetay.ExecuteScalar();
                if (s1 != null)
                {
                    FbDataReader IdOku = Detaylar.ExecuteReader();
                    while (IdOku.Read())
                    {
                        fk.Sil("TEKNIKTAKIPISLEMLER", "TK_ID='" + IdOku["TK_ID"].ToString() + "'");
                    }

                    byte sonuc;
                    sonuc = fk.Sil("Teknik_Takip", "Takip_no='" + label8.Text + "'");
                    if (sonuc == 1)
                    {
                        MessageBox.Show("Teknik Takip başarıyla silinmiştir", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Tkp.GridGuncelle();
                        Tkp.FormLoad();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Teknik Takip silinemedi ( Hata kodu: T-13 )", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Sistemsel bir hata oluştu, lütfen sağlayacınıza başvurunuz.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                b1.Close();
            }
        }