Пример #1
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            if (PROMOSYON_KODU.Text != "" && PROMOSYON_TANIMI.Text != "" && PUAN.Text != "")
            {
                WebService kntlService = new WebService();
                kntlService.SQLText = "SELECT PROMOSYON_KODU FROM TBLPROMOSYON WHERE PROMOSYON_KODU = '" + PROMOSYON_KODU.Text + "'";
                kntlService.Open();
                if (kntlService.DataCount() > 0)
                {
                    /*string image = "";
                     * if (!Goto724Lib.isNoImage(PROMOSYON_RESIM.Image)) image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(PROMOSYON_RESIM.Image));*/

                    string updStr = "UPDATE TBLPROMOSYON SET PROMOSYON_TANIMI = '" + PROMOSYON_TANIMI.Text + "'";

                    updStr += ", PUAN = " + Goto724Lib.RemoveChar(PUAN.Text, '.').Replace(',', '.');
                    updStr += ", STOK_ADEDI = " + Goto724Lib.RemoveChar(STOK_ADEDI.Text, '.').Replace(',', '.');
                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        updStr += ", PASIF_MI = 'H'";
                    }
                    else
                    {
                        updStr += ", PASIF_MI = 'E'";
                    }

                    if (ACIKLAMA.Text != "")
                    {
                        updStr += ", ACIKLAMA = '" + ACIKLAMA.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIKLAMA = NULL";
                    }

                    //if (image != "") updStr += ", PROMOSYON_RESIM = 0x" + image;

                    updStr += " WHERE PROMOSYON_KODU = '" + PROMOSYON_KODU.Text + "'";

                    WebService service = new WebService();
                    service.SQLText = updStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        WebService qryDelResim = new WebService();
                        qryDelResim.SQLText = "DELETE FROM TBLRESIM WHERE TABLO_ADI = 'TBLPROMOSYON' AND TABLO_DEGER = '" + PROMOSYON_KODU.Text + "'";
                        qryDelResim.Open();

                        int sira = 0;
                        foreach (Image image in imageList)
                        {
                            if (!Goto724Lib.isNoImage(image))
                            {
                                WebService qryInsResim = new WebService();
                                qryInsResim.SQLText  = "INSERT INTO TBLRESIM(TABLO_ADI, TABLO_DEGER, SIRA, RESIM) VALUES('TBLPROMOSYON', '" + PROMOSYON_KODU.Text + "', " + sira + ", ";
                                qryInsResim.SQLText += "0X" + Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(image));
                                qryInsResim.SQLText += ")";
                                qryInsResim.Open();
                            }
                            sira++;
                        }

                        GotoMessage.ShowMessage("Bilgi", "Kayıt Düzenleme Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
                else
                {
                    /*string image = "";
                     * if (!Goto724Lib.isNoImage(PROMOSYON_RESIM.Image)) image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(PROMOSYON_RESIM.Image));*/

                    string insStr = "INSERT INTO TBLPROMOSYON(PROMOSYON_KODU, PROMOSYON_TANIMI, PUAN, PASIF_MI, ACIKLAMA, STOK_ADEDI ";

                    /*if (image != "") insStr += ", PROMOSYON_RESIM) ";
                     * else insStr += ")";*/
                    insStr += ")";
                    insStr += "VALUES ('" + PROMOSYON_KODU.Text + "', '" + PROMOSYON_TANIMI.Text + "', " + Goto724Lib.RemoveChar(PUAN.Text, '.').Replace(',', '.');
                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        insStr += ", 'H'";
                    }
                    else
                    {
                        insStr += ", 'E'";
                    }

                    if (ACIKLAMA.Text != "")
                    {
                        insStr += ", '" + ACIKLAMA.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (STOK_ADEDI.Text != "")
                    {
                        insStr += ", '" + Goto724Lib.RemoveChar(STOK_ADEDI.Text, '.').Replace(',', '.') + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    //if (image != "") insStr += ", 0x" + image;
                    insStr += ")";

                    WebService service = new WebService();
                    service.SQLText = insStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        int sira = 0;
                        foreach (Image image in imageList)
                        {
                            if (!Goto724Lib.isNoImage(image))
                            {
                                WebService qryInsResim = new WebService();
                                qryInsResim.SQLText  = "INSERT INTO TBLRESIM(TABLO_ADI, TABLO_DEGER, SIRA, RESIM) VALUES('TBLPROMOSYON', '" + PROMOSYON_KODU.Text + "', " + sira + ", ";
                                qryInsResim.SQLText += "0x" + Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(image));
                                qryInsResim.SQLText += ")";
                                qryInsResim.Open();
                            }
                            sira++;
                        }

                        GotoMessage.ShowMessage("Bilgi", "Kayıt Başarıyla Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
            }
            else
            {
                string mesaj = "";
                if (PROMOSYON_KODU.Text == "")
                {
                    mesaj = "Tip Kodu";
                }
                else if (PROMOSYON_TANIMI.Text == "")
                {
                    mesaj = "Tip Tanımı";
                }
                else if (PUAN.Text == "")
                {
                    mesaj = "Puan";
                }
                mesaj += " Boş Olamaz";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }
Пример #2
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (KATEGORI_KOD.Text != "" && ACIKLAMA.Text != "")
            {
                WebService kntlService = new WebService();
                kntlService.SQLText = "SELECT KATEGORI_KODU FROM TBLKATEGORI WHERE KATEGORI_KODU = '" + KATEGORI_KOD.Text + "'";
                kntlService.Open();
                if (kntlService.DataCount() > 0)
                {
                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(KATEGORI_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(KATEGORI_RESIM.Image));
                    }

                    string updStr = "UPDATE TBLKATEGORI SET KATEGORI_ACIKLAMA = '" + ACIKLAMA.Text + "'";
                    if (image != "")
                    {
                        updStr += ", KATEGORI_RESIM = 0x" + image;
                    }
                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        updStr += ", PASIF_MI = 'H'";
                    }
                    else
                    {
                        updStr += ", PASIF_MI = 'E'";
                    }
                    updStr += " WHERE KATEGORI_KODU = '" + KATEGORI_KOD.Text + "'";

                    WebService service = new WebService();
                    service.SQLText = updStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        GotoMessage.ShowMessage("Bilgi", "Kayıt Düzenleme Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
                else
                {
                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(KATEGORI_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(KATEGORI_RESIM.Image));
                    }

                    string insStr = "INSERT INTO TBLKATEGORI(KATEGORI_KODU, KATEGORI_ACIKLAMA, PASIF_MI";
                    if (image != "")
                    {
                        insStr += ", KATEGORI_RESIM) ";
                    }
                    else
                    {
                        insStr += ")";
                    }
                    insStr += "VALUES ('" + KATEGORI_KOD.Text + "', '" + ACIKLAMA.Text + "'";
                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        insStr += ", 'H'";
                    }
                    else
                    {
                        insStr += ", 'E'";
                    }
                    if (image != "")
                    {
                        insStr += ", 0x" + image;
                    }
                    insStr += ")";

                    WebService service = new WebService();
                    service.SQLText = insStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        GotoMessage.ShowMessage("Bilgi", "Kayıt Başarıyla Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
            }
            else
            {
                string mesaj = "";
                if (KATEGORI_KOD.Text == "")
                {
                    mesaj = "Kategori Kodu";
                }
                else if (ACIKLAMA.Text == "")
                {
                    mesaj = "Kategori Açıklama";
                }
                mesaj += " Boş Olamaz";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }
Пример #3
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            if (TIP_KOD.Text != "" && TIP_TANIM.Text != "" && KATEGORI_KODU.Text != "")
            {
                WebService kntlService = new WebService();
                kntlService.SQLText = "SELECT TIP_KODU FROM TBLSTOKTIP WHERE TIP_KODU = '" + TIP_KOD.Text + "' AND TEDARIKCI_KODU = '" + Goto724Lib.tedarikciKodu + "'";
                kntlService.Open();
                if (kntlService.DataCount() > 0)
                {
                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(TIP_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(TIP_RESIM.Image));
                    }

                    string updStr = "UPDATE TBLSTOKTIP SET TIP_TANIMI = '" + TIP_TANIM.Text + "'";

                    if (ACIKLAMA.Text != "")
                    {
                        updStr += ", ACIKLAMA = '" + ACIKLAMA.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIKLAMA = NULL";
                    }

                    if (KATEGORI_KODU.Text != "")
                    {
                        updStr += ", KATEGORI_KODU = '" + KATEGORI_KODU.GetString() + "'";
                    }
                    else
                    {
                        updStr += ", KATEGORI_KODU = NULL";
                    }

                    if (image != "")
                    {
                        updStr += ", TIP_RESIM = 0x" + image;
                    }

                    /*if (grdTipOran.Rows[0].Cells["grdEt"].Value == null) updStr += ", ET_ORAN = 0";
                     * else updStr += ", ET_ORAN = " + grdTipOran.Rows[0].Cells["grdEt"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdKiyma"].Value == null) updStr += ", KIYMA_ORAN = 0";
                     * else updStr += ", KIYMA_ORAN = " + grdTipOran.Rows[0].Cells["grdKiyma"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdDana"].Value == null) updStr += ", DANA_ORAN = 0";
                     * else updStr += ", DANA_ORAN = " + grdTipOran.Rows[0].Cells["grdDana"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdHindi"].Value == null) updStr += ", HINDI_ORAN = 0";
                     * else updStr += ", HINDI_ORAN = " + grdTipOran.Rows[0].Cells["grdHindi"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdTavuk"].Value == null) updStr += ", TAVUK_ORAN = 0";
                     * else updStr += ", TAVUK_ORAN = " + grdTipOran.Rows[0].Cells["grdTavuk"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdYag"].Value == null) updStr += ", YAG_ORAN = 0";
                     * else updStr += ", YAG_ORAN = " + grdTipOran.Rows[0].Cells["grdYag"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdBaharat"].Value == null) updStr += ", BAHARAT_ORAN = 0";
                     * else updStr += ", BAHARAT_ORAN = " + grdTipOran.Rows[0].Cells["grdBaharat"].Value;*/

                    /*updStr += ", ET_ORAN = " + grdTipOran.Rows[0].Cells["grdEt"].Value;
                     * updStr += ", KIYMA_ORAN = " + grdTipOran.Rows[0].Cells["grdKiyma"].Value;
                     * updStr += ", DANA_ORAN = " + grdTipOran.Rows[0].Cells["grdDana"].Value;
                     * updStr += ", HINDI_ORAN = " + grdTipOran.Rows[0].Cells["grdHindi"].Value;
                     * updStr += ", TAVUK_ORAN = " + grdTipOran.Rows[0].Cells["grdTavuk"].Value;
                     * updStr += ", YAG_ORAN = " + grdTipOran.Rows[0].Cells["grdYag"].Value;
                     * updStr += ", BAHARAT_ORAN = " + grdTipOran.Rows[0].Cells["grdBaharat"].Value;*/

                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        updStr += ", PASIF_MI = 'H'";
                    }
                    else
                    {
                        updStr += ", PASIF_MI = 'E'";
                    }

                    updStr += " WHERE TIP_KODU = '" + TIP_KOD.Text + "' AND TEDARIKCI_KODU = '" + Goto724Lib.tedarikciKodu + "'";
                    WebService service = new WebService();
                    service.SQLText = updStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        GotoMessage.ShowMessage("Bilgi", "Kayıt Düzenleme Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
                else
                {
                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(TIP_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(TIP_RESIM.Image));
                    }

                    string insStr = "INSERT INTO TBLSTOKTIP(TIP_KODU, TIP_TANIMI, TEDARIKCI_KODU, ACIKLAMA, KATEGORI_KODU, PASIF_MI";
                    if (image != "")
                    {
                        insStr += ", TIP_RESIM) ";
                    }
                    else
                    {
                        insStr += ")";
                    }
                    insStr += "VALUES ('" + TIP_KOD.Text + "', '" + TIP_TANIM.Text + "', '" + Goto724Lib.tedarikciKodu + "'";

                    if (ACIKLAMA.Text != "")
                    {
                        insStr += ", '" + ACIKLAMA.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (KATEGORI_KODU.Text != "")
                    {
                        insStr += ", '" + KATEGORI_KODU.GetString() + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    /*if (grdTipOran.Rows[0].Cells["grdEt"].Value == null) insStr += ", 0";
                     * else insStr += ", " + grdTipOran.Rows[0].Cells["grdEt"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdKiyma"].Value == null) insStr += ", 0";
                     * else insStr += ", " + grdTipOran.Rows[0].Cells["grdKiyma"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdDana"].Value == null) insStr += ", 0";
                     * else insStr += ", " + grdTipOran.Rows[0].Cells["grdDana"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdHindi"].Value == null) insStr += ", 0";
                     * else insStr += ", " + grdTipOran.Rows[0].Cells["grdHindi"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdTavuk"].Value == null) insStr += ", 0";
                     * else insStr += ", " + grdTipOran.Rows[0].Cells["grdTavuk"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdYag"].Value == null) insStr += ", 0";
                     * else insStr += ", " + grdTipOran.Rows[0].Cells["grdYag"].Value;
                     * if (grdTipOran.Rows[0].Cells["grdBaharat"].Value == null) insStr += ", 0";
                     * else insStr += ", " + grdTipOran.Rows[0].Cells["grdBaharat"].Value;*/

                    /*insStr += ", " + grdTipOran.Rows[0].Cells["grdEt"].Value;
                     * insStr += ", " + grdTipOran.Rows[0].Cells["grdKiyma"].Value;
                     * insStr += ", " + grdTipOran.Rows[0].Cells["grdDana"].Value;
                     * insStr += ", " + grdTipOran.Rows[0].Cells["grdHindi"].Value;
                     * insStr += ", " + grdTipOran.Rows[0].Cells["grdTavuk"].Value;
                     * insStr += ", " + grdTipOran.Rows[0].Cells["grdYag"].Value;
                     * insStr += ", " + grdTipOran.Rows[0].Cells["grdBaharat"].Value;*/

                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        insStr += ", 'H'";
                    }
                    else
                    {
                        insStr += ", 'E'";
                    }

                    if (image != "")
                    {
                        insStr += ", 0x" + image;
                    }
                    insStr += ")";

                    WebService service = new WebService();
                    service.SQLText = insStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        GotoMessage.ShowMessage("Bilgi", "Kayıt Başarıyla Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
            }
            else
            {
                string mesaj = "";
                if (TIP_KOD.Text == "")
                {
                    mesaj = "Tip Kodu";
                }
                else if (TIP_TANIM.Text == "")
                {
                    mesaj = "Tip Tanımı";
                }
                else if (KATEGORI_KODU.Text == "")
                {
                    mesaj = "Kategori";
                }
                mesaj += " Boş Olamaz";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }
Пример #4
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (STOK_KOD.Text != "" && STOK_AD.Text != "" && STOK_KATEGORI.Text != "" && STOK_TIPI.Text != "")
            {
                WebService kntlService = new WebService();
                kntlService.SQLText = "SELECT STOK_KODU FROM TBLSTOK WHERE STOK_KODU = '" + STOK_KOD.Text + "' AND TEDARIKCI_KODU = '" + Goto724Lib.tedarikciKodu + "'";
                kntlService.Open();
                if (kntlService.DataCount() > 0)
                {
                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(STOK_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(STOK_RESIM.Image));
                    }

                    string updStr = "UPDATE TBLSTOK SET STOK_ADI = '" + STOK_AD.Text + "', TEDARIKCI_KODU = '" + Goto724Lib.tedarikciKodu + "'";

                    if (image != "")
                    {
                        updStr += ", STOK_RESIM = 0x" + image;
                    }

                    if (STOK_TIPI.GetString() != "")
                    {
                        updStr += ", STOK_TIPI = '" + STOK_TIPI.GetString() + "'";
                    }
                    else
                    {
                        updStr += ", STOK_TIPI = NULL";
                    }

                    if (STOK_KATEGORI.GetString() != "")
                    {
                        updStr += ", KATEGORI_KODU = '" + STOK_KATEGORI.GetString() + "'";
                    }
                    else
                    {
                        updStr += ", KATEGORI_KODU = NULL";
                    }

                    if (ACIKLAMA1.Text != "")
                    {
                        updStr += ", ACIKLAMA_1 = '" + ACIKLAMA1.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIKLAMA_1 = NULL";
                    }

                    if (ACIKLAMA2.Text != "")
                    {
                        updStr += ", ACIKLAMA_2 = '" + ACIKLAMA2.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIKLAMA_2 = NULL";
                    }

                    if (ACIKLAMA3.Text != "")
                    {
                        updStr += ", ACIKLAMA_3 = '" + ACIKLAMA3.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIKLAMA_3 = NULL";
                    }

                    if (ALIS_FIYAT1.Text != "")
                    {
                        updStr += ", ALIS_FIYAT1 = " + Goto724Lib.RemoveChar(ALIS_FIYAT1.Text, '.').Replace(',', '.') + "";
                    }
                    else
                    {
                        updStr += ", ALIS_FIYAT1 = NULL";
                    }

                    if (SATIS_FIYAT1.Text != "")
                    {
                        updStr += ", SATIS_FIYAT1 = " + Goto724Lib.RemoveChar(SATIS_FIYAT1.Text, '.').Replace(',', '.') + "";
                    }
                    else
                    {
                        updStr += ", SATIS_FIYAT1 = NULL";
                    }

                    for (int i = 0; i < grdStokFiyat.Rows.Count; i++)
                    {
                        if (grdStokFiyat.Rows[i].Cells["grdFiyat"].Value != null)
                        {
                            updStr += ", SATIS_FIYAT" + (i + 2) + " = " + Goto724Lib.RemoveChar(grdStokFiyat.Rows[i].Cells["grdFiyat"].Value.ToString(), '.').Replace(',', '.');
                        }
                        else
                        {
                            updStr += ", SATIS_FIYAT" + (i + 2) + " = 0";
                        }
                    }

                    //if (ALIS_FIYAT1.Text != "") updStr += ", ALIS_FIYAT1 = '" + ALIS_FIYAT1.Text + "'";
                    //else updStr += ", ALIS_FIYAT1 = NULL";

                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        updStr += ", PASIF_MI = 'H'";
                    }
                    else
                    {
                        updStr += ", PASIF_MI = 'E'";
                    }

                    if (STOK_KATEGORI.Text == "Döner Kebap")
                    {
                        if (grdStokOran.Rows[0].Cells["grdEt"].Value == null)
                        {
                            updStr += ", ET_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", ET_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdEt"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdKiyma"].Value == null)
                        {
                            updStr += ", KIYMA_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", KIYMA_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdKiyma"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdDana"].Value == null)
                        {
                            updStr += ", DANA_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", DANA_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdDana"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdSutDana"].Value == null)
                        {
                            updStr += ", SUT_DANA_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", SUT_DANA_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdSutDana"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdHindi"].Value == null)
                        {
                            updStr += ", HINDI_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", HINDI_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdHindi"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdTavuk"].Value == null)
                        {
                            updStr += ", TAVUK_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", TAVUK_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdTavuk"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdYag"].Value == null)
                        {
                            updStr += ", YAG_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", YAG_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdYag"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdBaharat"].Value == null)
                        {
                            updStr += ", BAHARAT_ORAN = 0";
                        }
                        else
                        {
                            updStr += ", BAHARAT_ORAN = " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdBaharat"].Value) * 100).ToString().Replace(',', '.');
                        }
                    }

                    updStr += " WHERE STOK_KODU = '" + STOK_KOD.Text + "' AND TEDARIKCI_KODU = '" + Goto724Lib.tedarikciKodu + "'";

                    WebService service = new WebService();
                    service.SQLText = updStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        GotoMessage.ShowMessage("Bilgi", "Kayıt Düzenleme Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
                else
                {
                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(STOK_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(STOK_RESIM.Image));
                    }

                    string insStr = "INSERT INTO TBLSTOK(STOK_KODU, STOK_ADI, TEDARIKCI_KODU, STOK_TIPI, KATEGORI_KODU, ACIKLAMA_1, ACIKLAMA_2, ACIKLAMA_3, ALIS_FIYAT1, SATIS_FIYAT1, ET_ORAN, KIYMA_ORAN, DANA_ORAN, SUT_DANA_ORAN, HINDI_ORAN, TAVUK_ORAN, YAG_ORAN, BAHARAT_ORAN, SATIS_FIYAT2, SATIS_FIYAT3, SATIS_FIYAT4, SATIS_FIYAT5, SATIS_FIYAT6, SATIS_FIYAT7, SATIS_FIYAT8, PASIF_MI";
                    if (image != "")
                    {
                        insStr += ", STOK_RESIM) ";
                    }
                    else
                    {
                        insStr += ")";
                    }
                    insStr += "VALUES ('" + STOK_KOD.Text + "', '" + STOK_AD.Text + "', '" + Goto724Lib.tedarikciKodu + "'";

                    if (STOK_TIPI.GetString() != "")
                    {
                        insStr += ", '" + STOK_TIPI.GetString() + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (STOK_KATEGORI.GetString() != "")
                    {
                        insStr += ", '" + STOK_KATEGORI.GetString() + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ACIKLAMA1.Text != "")
                    {
                        insStr += ", '" + ACIKLAMA1.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ACIKLAMA2.Text != "")
                    {
                        insStr += ", '" + ACIKLAMA2.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ACIKLAMA3.Text != "")
                    {
                        insStr += ", '" + ACIKLAMA3.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ALIS_FIYAT1.Text != "")
                    {
                        insStr += ", '" + Goto724Lib.RemoveChar(ALIS_FIYAT1.Text, '.').Replace(',', '.') + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (SATIS_FIYAT1.Text != "")
                    {
                        insStr += ", '" + Goto724Lib.RemoveChar(SATIS_FIYAT1.Text, '.').Replace(',', '.') + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (STOK_KATEGORI.Text == "Döner Kebap")
                    {
                        if (grdStokOran.Rows[0].Cells["grdEt"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdEt"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdKiyma"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdKiyma"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdDana"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdDana"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdSutDana"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdSutDana"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdHindi"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdHindi"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdTavuk"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdTavuk"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdYag"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdYag"].Value) * 100).ToString().Replace(',', '.');
                        }
                        if (grdStokOran.Rows[0].Cells["grdBaharat"].Value == null)
                        {
                            insStr += ", 0";
                        }
                        else
                        {
                            insStr += ", " + (Convert.ToDouble(grdStokOran.Rows[0].Cells["grdBaharat"].Value) * 100).ToString().Replace(',', '.');
                        }
                    }
                    else
                    {
                        insStr += ",0,0,0,0,0,0,0,0";
                    }

                    for (int i = 0; i < grdStokFiyat.Rows.Count; i++)
                    {
                        if (grdStokFiyat.Rows[i].Cells["grdFiyat"].Value != null)
                        {
                            insStr += ", " + Goto724Lib.RemoveChar(grdStokFiyat.Rows[i].Cells["grdFiyat"].Value.ToString(), '.').Replace(',', '.');
                        }
                        else
                        {
                            insStr += ", 0";
                        }
                    }

                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        insStr += ", 'H'";
                    }
                    else
                    {
                        insStr += ", 'E'";
                    }

                    if (image != "")
                    {
                        insStr += ", 0x" + image;
                    }

                    insStr += ")";

                    WebService service = new WebService();
                    service.SQLText = insStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        if (STOK_KATEGORI.Text == "Döner Kebap")
                        {
                            for (int i = 0; i < 20; i++)
                            {
                                WebService paketService = new WebService();
                                paketService.SQLText = "INSERT INTO TBLSTOKPAKET(PAKET_KODU, STOK_KODU, BIRIM_KODU, TEDARIKCI_KODU, MIKTAR, ACIKLAMA)" +
                                                       "VALUES('" + STOK_KOD.Text + "" + (i + 1).ToString("000") + "', '" + STOK_KOD.Text + "', 'KG', '" + Goto724Lib.tedarikciKodu + "', " + ((i + 1) * 5) + ", '" + ((i + 1) * 5) + " Kg" + "')";
                                paketService.Open();
                            }
                        }

                        GotoMessage.ShowMessage("Bilgi", "Kayıt Başarıyla Tamamlandı");
                        PanelClear();
                        RefreshGrid();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
            }
            else
            {
                string mesaj = "";
                if (STOK_KOD.Text == "")
                {
                    mesaj = "Stok Kodu";
                }
                else if (STOK_AD.Text == "")
                {
                    mesaj = "Stok Adı";
                }
                else if (STOK_KATEGORI.Text == "")
                {
                    mesaj = "Kategori";
                }
                else if (STOK_TIPI.Text == "")
                {
                    mesaj = "Stok Tipi";
                }
                mesaj += " Boş Olamaz!!";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }
Пример #5
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (TEDARIKCI_KOD.Text != "" && TEDARIKCI_AD.Text != "")
            {
                WebService kntlService = new WebService();
                kntlService.SQLText = "SELECT TEDARIKCI_KODU FROM TBLTEDARIKCI WHERE TEDARIKCI_KODU = '" + TEDARIKCI_KOD.Text + "'";
                kntlService.Open();
                if (kntlService.DataCount() > 0)
                {
                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(TEDARIKCI_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(TEDARIKCI_RESIM.Image));
                    }

                    string updStr = "UPDATE TBLTEDARIKCI SET TEDARIKCI_ADI = '" + TEDARIKCI_AD.Text + "'";

                    if (UST_NO.Text != "")
                    {
                        updStr += ", UST_NO = '" + UST_NO.Text + "'";
                    }
                    else
                    {
                        updStr += ", UST_NO = NULL";
                    }

                    if (CADDE_SOKAK.Text != "")
                    {
                        updStr += ", CADDE_SOKAK = '" + CADDE_SOKAK.Text + "'";
                    }
                    else
                    {
                        updStr += ", CADDE_SOKAK = NULL";
                    }

                    if (ULKE.Text != "")
                    {
                        updStr += ", ULKE = '" + ULKE.Text + "'";
                    }
                    else
                    {
                        updStr += ", ULKE = NULL";
                    }

                    if (BINA_NO.Text != "")
                    {
                        updStr += ", BINA_NO = '" + BINA_NO.Text + "'";
                    }
                    else
                    {
                        updStr += ", BINA_NO = NULL";
                    }

                    if (SEHIR.Text != "")
                    {
                        updStr += ", SEHIR = '" + SEHIR.Text + "'";
                    }
                    else
                    {
                        updStr += ", SEHIR = NULL";
                    }

                    if (POSTA_KODU.Text != "")
                    {
                        updStr += ", POSTA_KODU = '" + POSTA_KODU.Text + "'";
                    }
                    else
                    {
                        updStr += ", POSTA_KODU = NULL";
                    }

                    if (TEL_NO.Text != "")
                    {
                        updStr += ", TEL_NO = '" + TEL_NO.Text + "'";
                    }
                    else
                    {
                        updStr += ", TEL_NO = NULL";
                    }

                    if (CEP_TELNO.Text != "")
                    {
                        updStr += ", CEP_TEL = '" + CEP_TELNO.Text + "'";
                    }
                    else
                    {
                        updStr += ", CEP_TEL = NULL";
                    }

                    if (EPOSTA.Text != "")
                    {
                        updStr += ", E_POSTA = '" + EPOSTA.Text + "'";
                    }
                    else
                    {
                        updStr += ", E_POSTA = NULL";
                    }

                    if (WEBSITE.Text != "")
                    {
                        updStr += ", WEB_SITE = '" + WEBSITE.Text + "'";
                    }
                    else
                    {
                        updStr += ", WEB_SITE = NULL";
                    }

                    if (ACIKLAMA1.Text != "")
                    {
                        updStr += ", ACIKLAMA_1 = '" + ACIKLAMA1.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIKLAMA_1 = NULL";
                    }

                    if (ACIKLAMA2.Text != "")
                    {
                        updStr += ", ACIKLAMA_2 = '" + ACIKLAMA2.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIKLAMA_2 = NULL";
                    }

                    if (TEDARIKCI_KISA_AD.Text != "")
                    {
                        updStr += ", TEDARIKCI_KISA_AD = '" + TEDARIKCI_KISA_AD.Text + "'";
                    }
                    else
                    {
                        updStr += ", TEDARIKCI_KISA_AD = NULL";
                    }

                    if (FAX.Text != "")
                    {
                        updStr += ", FAX = '" + FAX.Text + "'";
                    }
                    else
                    {
                        updStr += ", FAX = NULL";
                    }

                    if (ACIL_TELNO.Text != "")
                    {
                        updStr += ", ACIL_TELNO = '" + ACIL_TELNO.Text + "'";
                    }
                    else
                    {
                        updStr += ", ACIL_TELNO = NULL";
                    }

                    if (TEL_NO2.Text != "")
                    {
                        updStr += ", TEL_NO2 = '" + TEL_NO2.Text + "'";
                    }
                    else
                    {
                        updStr += ", TEL_NO2 = NULL";
                    }

                    if (TEL_NO3.Text != "")
                    {
                        updStr += ", TEL_NO3 = '" + TEL_NO3.Text + "'";
                    }
                    else
                    {
                        updStr += ", TEL_NO3 = NULL";
                    }

                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        updStr += ", PASIF_MI = 'H'";
                    }
                    else
                    {
                        updStr += ", PASIF_MI = 'E'";
                    }

                    if (image != "")
                    {
                        updStr += ", TEDARIKCI_RESIM = 0x" + image;
                    }

                    if (chbKATEGORI.SelectedIndex != -1)
                    {
                        updStr += ", KATEGORI= '" + SecilenKategori() + "'";
                    }
                    else
                    {
                        updStr += ", KATEGORI= NULL";
                    }

                    updStr += " WHERE TEDARIKCI_KODU = '" + TEDARIKCI_KOD.Text + "'";

                    WebService service = new WebService();
                    service.SQLText = updStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        GotoMessage.ShowMessage("Bilgi", "Kayıt Düzenleme Tamamlandı");
                        if (Goto724Lib.adminMi)
                        {
                            PanelClear();
                            RefreshGrid();
                        }
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
                else
                {
                    WebService lisansService = new WebService();
                    lisansService.SQLText = "SELECT SON_NUMARA FROM TBLOTONUM WHERE NUMARA_KODU = '" + DateTime.Now.ToString("yyMM") + "_LISANS'";
                    lisansService.Open();
                    bool lisansUpKontrol = false;
                    int  sonNum          = 0;
                    if (lisansService.DataCount() > 0)
                    {
                        lisansUpKontrol      = true;
                        sonNum               = Convert.ToInt32(lisansService.GetString("SON_NUMARA"));
                        LISANS_NUMARASI.Text = Goto724Lib.CreateLisansNumarasi(sonNum);
                        LISANS_SIFRESI.Text  = Goto724Lib.CreateLisansSifresi();
                    }
                    else
                    {
                        LISANS_NUMARASI.Text = Goto724Lib.CreateLisansNumarasi(0);
                        LISANS_SIFRESI.Text  = Goto724Lib.CreateLisansSifresi();
                    }

                    string image = "";
                    if (imageChanged && !Goto724Lib.isNoImage(TEDARIKCI_RESIM.Image))
                    {
                        image = Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(TEDARIKCI_RESIM.Image));
                    }

                    string insStr = "INSERT INTO TBLTEDARIKCI(TEDARIKCI_KODU, TEDARIKCI_ADI, UST_NO, CADDE_SOKAK, TEL_NO, CEP_TEL, E_POSTA, WEB_SITE, ACIKLAMA_1, ACIKLAMA_2, BINA_NO, SEHIR, POSTA_KODU, ULKE, TEDARIKCI_KISA_AD, FAX, ACIL_TELNO, TEL_NO2, TEL_NO3, PASIF_MI, LISANS_NUMARASI,  LISANS_SIFRESI, KATEGORI";
                    if (image != "")
                    {
                        insStr += ", TEDARIKCI_RESIM) ";
                    }
                    else
                    {
                        insStr += ")";
                    }
                    insStr += "VALUES ('" + TEDARIKCI_KOD.Text + "', '" + TEDARIKCI_AD.Text + "'";

                    if (UST_NO.Text != "")
                    {
                        insStr += ", '" + UST_NO.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (CADDE_SOKAK.Text != "")
                    {
                        insStr += ", '" + CADDE_SOKAK.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (TEL_NO.Text != "")
                    {
                        insStr += ", '" + TEL_NO.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (CEP_TELNO.Text != "")
                    {
                        insStr += ", '" + CEP_TELNO.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (EPOSTA.Text != "")
                    {
                        insStr += ", '" + EPOSTA.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (WEBSITE.Text != "")
                    {
                        insStr += ", '" + WEBSITE.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ACIKLAMA1.Text != "")
                    {
                        insStr += ", '" + ACIKLAMA1.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ACIKLAMA2.Text != "")
                    {
                        insStr += ", '" + ACIKLAMA2.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (BINA_NO.Text != "")
                    {
                        insStr += ", '" + BINA_NO.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (SEHIR.Text != "")
                    {
                        insStr += ", '" + SEHIR.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (POSTA_KODU.Text != "")
                    {
                        insStr += ", '" + POSTA_KODU.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ULKE.Text != "")
                    {
                        insStr += ", '" + ULKE.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (TEDARIKCI_KISA_AD.Text != "")
                    {
                        insStr += ", '" + TEDARIKCI_KISA_AD.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (FAX.Text != "")
                    {
                        insStr += ", '" + FAX.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (ACIL_TELNO.Text != "")
                    {
                        insStr += ", '" + ACIL_TELNO.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (TEL_NO2.Text != "")
                    {
                        insStr += ", '" + TEL_NO2.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (TEL_NO3.Text != "")
                    {
                        insStr += ", '" + TEL_NO3.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (PASIF_MI.SelectedIndex == -1 || PASIF_MI.SelectedIndex == 0)
                    {
                        insStr += ", 'H'";
                    }
                    else
                    {
                        insStr += ", 'E'";
                    }

                    insStr += ", '" + LISANS_NUMARASI.Text + "'";
                    insStr += ", '" + LISANS_SIFRESI.Text + "'";

                    if (chbKATEGORI.SelectedIndex != -1)
                    {
                        insStr += ", '" + SecilenKategori() + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

                    if (image != "")
                    {
                        insStr += ", 0x" + image;
                    }

                    insStr += ")";

                    WebService service = new WebService();
                    service.SQLText = insStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        WebService lisansService2 = new WebService();
                        if (lisansUpKontrol)
                        {
                            lisansService2.SQLText = "UPDATE TBLOTONUM SET SON_NUMARA = '" + (sonNum + 1) + "' WHERE NUMARA_KODU = '" + DateTime.Now.ToString("yyMM") + "_LISANS'";
                        }
                        else
                        {
                            lisansService2.SQLText = "INSERT INTO TBLOTONUM(SON_NUMARA, NUMARA_KODU) VALUES('" + (sonNum + 1) + "', '" + DateTime.Now.ToString("yyMM") + "_LISANS')";
                        }
                        lisansService2.Open();

                        string kullaniciInsStr = "INSERT INTO TBLKULLANICI(LISANS_NUMARASI, KULLANICI_ADI, ADMIN_MI, SIFRE, E_POSTA, TEL_NO) VALUES('" + LISANS_NUMARASI.Text + "', '" + TEDARIKCI_KOD.Text + "', 'H', '123'";

                        if (EPOSTA.Text != "")
                        {
                            kullaniciInsStr += ", '" + EPOSTA.Text + "'";
                        }
                        else
                        {
                            kullaniciInsStr += ", NULL";
                        }

                        if (TEL_NO.Text != "")
                        {
                            kullaniciInsStr += ", '" + TEL_NO.Text + "'";
                        }
                        else
                        {
                            kullaniciInsStr += ", NULL";
                        }

                        kullaniciInsStr += ")";

                        WebService kullaniciServis = new WebService();
                        kullaniciServis.SQLText = kullaniciInsStr;
                        kullaniciServis.Open();

                        List <DefStokTip> defStokTips = DefStokTips();
                        foreach (DefStokTip stokTip in defStokTips)
                        {
                            WebService stokTipQry = new WebService();
                            stokTipQry.SQLText = "INSERT INTO TBLSTOKTIP(TIP_KODU, TIP_TANIMI, TIP_RESIM, TEDARIKCI_KODU, ET_ORAN, KIYMA_ORAN, DANA_ORAN, HINDI_ORAN, TAVUK_ORAN, YAG_ORAN, BAHARAT_ORAN, KATEGORI_KODU, PASIF_MI) " +
                                                 "VALUES('" + stokTip.tipKodu + "', '" + stokTip.tipTanimi + "', 0x" + Goto724Lib.ByteArrayToString(Goto724Lib.ImageToByteArray(stokTip.img)) + ", '" + TEDARIKCI_KOD.Text + "', " + stokTip.etOran + ", "
                                                 + stokTip.kiymaOran + ", " + stokTip.danaOran + ", " + stokTip.hindiOran + ", " + stokTip.tavukOran + ", " + stokTip.yagOran + ", " + stokTip.baharatOran + ", '" + stokTip.kategoriKodu + "', 'H')";
                            stokTipQry.Open();
                        }

                        GotoMessage.ShowMessage("Bilgi", "Kayıt Başarıyla Tamamlandı");
                        GotoMessage.ShowMessage("Bilgi", TEDARIKCI_AD.Text + " Lisans Bilgileri\nLisans Numarası: " + LISANS_NUMARASI.Text + "\nLisans Şifresi: " + LISANS_SIFRESI.Text);
                        if (Goto724Lib.adminMi)
                        {
                            PanelClear();
                            RefreshGrid();
                        }
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                    }
                }
            }
            else
            {
                string mesaj = "";
                if (TEDARIKCI_KOD.Text == "")
                {
                    mesaj = "Tedarikçi Kodu";
                }
                else if (TEDARIKCI_AD.Text == "")
                {
                    mesaj = "Tedarikçi Adı";
                }
                mesaj += " Boş Olamaz!!";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }