Example #1
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);
            }
        }
Example #2
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);
            }
        }
Example #3
0
        private void btnKaydetYetkili_Click(object sender, EventArgs e)
        {
            if (YETKILI_KOD.Text != "" && YETKILI_AD.Text != "" && YET_TEDARIKCI_KODU.GetString() != "")
            {
                WebService yetkiliTedKntl = new WebService();
                yetkiliTedKntl.SQLText = "SELECT TEDARIKCI_KODU FROM TBLTEDARIKCI WHERE TEDARIKCI_KODU = '" + YET_TEDARIKCI_KODU.GetString() + "'";
                yetkiliTedKntl.Open();
                if (yetkiliTedKntl.DataCount() > 0)
                {
                    WebService kntlService = new WebService();
                    kntlService.SQLText = "SELECT YETKILI_KODU FROM TBLTEDARIKCIYETKILI WHERE YETKILI_KODU = '" + YETKILI_KOD.Text + "'";
                    kntlService.Open();
                    if (kntlService.DataCount() > 0)
                    {
                        string updStr = "UPDATE TBLTEDARIKCIYETKILI SET YETKILI_ADI = '" + YETKILI_AD.Text + "', TEDARIKCI_KODU = '" + YET_TEDARIKCI_KODU.GetString() + "'";

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

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

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

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

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

                        updStr += " WHERE YETKILI_KODU = '" + YETKILI_KOD.Text + "'";

                        WebService service = new WebService();
                        service.SQLText = updStr;
                        service.Open();
                        if (service.errorCode == "0")
                        {
                            GotoMessage.ShowMessage("Bilgi", "Kayıt Düzenleme Tamamlandı");
                            YetkiliPanelClear();
                            RefreshYetkiliGrid();
                        }
                        else
                        {
                            GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                        }
                    }
                    else
                    {
                        string insStr = "INSERT INTO TBLTEDARIKCIYETKILI(YETKILI_KODU, YETKILI_ADI, TEDARIKCI_KODU, GOREV, TEL_NO, CEP_TEL, E_POSTA, ACIKLAMA)";
                        insStr += "VALUES ('" + YETKILI_KOD.Text + "', '" + YETKILI_AD.Text + "', '" + YET_TEDARIKCI_KODU.GetString() + "'";

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

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

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

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

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

                        insStr += ")";

                        WebService service = new WebService();
                        service.SQLText = insStr;
                        service.Open();
                        if (service.errorCode == "0")
                        {
                            GotoMessage.ShowMessage("Bilgi", "Kayıt Başarıyla Tamamlandı");
                            YetkiliPanelClear();
                            RefreshYetkiliGrid();
                        }
                        else
                        {
                            GotoMessage.ShowMessage("Hata", "Kayıt Aktarılırken Hatayla Karşılaşıldı.\nHata: " + service.description);
                        }
                    }
                }
                else
                {
                    GotoMessage.ShowMessage("Hata", "Tedarikçi Kodu Hatalı");
                    YET_TEDARIKCI_KODU.Focus();
                }
            }
            else
            {
                string mesaj = "";
                if (YETKILI_KOD.Text == "")
                {
                    mesaj = "Yetkili Kodu";
                }
                else if (YETKILI_AD.Text == "")
                {
                    mesaj = "Yetkili Adı";
                }
                else if (YET_TEDARIKCI_KODU.GetString() == "")
                {
                    mesaj = "Tedarikçi Kodu";
                }
                mesaj += " Boş Olamaz!!";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }
Example #4
0
 private void ScreenFill(WebService service)
 {
     for (int i = 0; i < chbKATEGORI.Items.Count; i++)
     {
         chbKATEGORI.SetItemChecked(i, false);
     }
     TEDARIKCI_KOD.Text     = service.GetString("TEDARIKCI_KODU");
     TEDARIKCI_AD.Text      = service.GetString("TEDARIKCI_ADI");
     ULKE.Text              = service.GetString("ULKE");
     UST_NO.Text            = service.GetString("UST_NO");
     CADDE_SOKAK.Text       = service.GetString("CADDE_SOKAK");
     BINA_NO.Text           = service.GetString("BINA_NO");
     SEHIR.Text             = service.GetString("SEHIR");
     POSTA_KODU.Text        = service.GetString("POSTA_KODU");
     TEL_NO.Text            = service.GetString("TEL_NO");
     CEP_TELNO.Text         = service.GetString("CEP_TEL");
     EPOSTA.Text            = service.GetString("E_POSTA");
     WEBSITE.Text           = service.GetString("WEB_SITE");
     ACIKLAMA1.Text         = service.GetString("ACIKLAMA_1");
     ACIKLAMA2.Text         = service.GetString("ACIKLAMA_2");
     TEDARIKCI_KISA_AD.Text = service.GetString("TEDARIKCI_KISA_AD");
     FAX.Text        = service.GetString("FAX");
     ACIL_TELNO.Text = service.GetString("ACIL_TELNO");
     TEL_NO2.Text    = service.GetString("TEL_NO2");
     TEL_NO3.Text    = service.GetString("TEL_NO3");
     if (service.GetString("KATEGORI") != "")
     {
         string[] aa = service.GetString("KATEGORI").Split(';');
         for (int i = 0; i < aa.Length; i++)
         {
             int j = 0;
             foreach (string bb in Kategori.Keys)
             {
                 if (aa[i].ToString() == Kategori[bb].ToString())
                 {
                     chbKATEGORI.SetItemChecked(j, true);
                     break;
                 }
                 j++;
             }
         }
     }
     if (service.GetString("PASIF_MI") == "H")
     {
         PASIF_MI.SelectedIndex = 0;
     }
     else
     {
         PASIF_MI.SelectedIndex = 1;
     }
     LISANS_NUMARASI.Text = service.GetString("LISANS_NUMARASI");
     LISANS_SIFRESI.Text  = service.GetString("LISANS_SIFRESI");
     if (service.tags.Contains("TEDARIKCI_RESIM") && service.GetString("TEDARIKCI_RESIM") != "")
     {
         TEDARIKCI_RESIM.Image = service.GetImage("TEDARIKCI_RESIM");                                                                                        //Goto724Lib.Base64ToImage(service.GetString("TIP_RESIM"));
     }
     else
     {
         TEDARIKCI_RESIM.Image = Goto724Lib.noImage;
     }
 }