Example #1
0
 private void ALIS_FIYAT1_Leave(object sender, EventArgs e)
 {
     if (ALIS_FIYAT1.Text != "")
     {
         ALIS_FIYAT1.TextChanged -= new EventHandler(ALIS_FIYAT1_TextChanged);
         double doubleVal = Convert.ToDouble(Goto724Lib.RemoveChar(ALIS_FIYAT1.Text, '.'));
         if (doubleVal == 0.0)
         {
             ALIS_FIYAT1.Text = "";
         }
         else
         {
             string decimalStr = "";
             for (int i = 0; i < 2; i++)
             {
                 decimalStr += "0";
             }
             ALIS_FIYAT1.Text = doubleVal.ToString("#,0." + decimalStr);
         }
         afLastText = ALIS_FIYAT1.Text;
         ALIS_FIYAT1.SelectionStart = ALIS_FIYAT1.Text.Length;
         ALIS_FIYAT1.TextChanged   += new EventHandler(ALIS_FIYAT1_TextChanged);
     }
     else
     {
         ALIS_FIYAT1.TextChanged -= new EventHandler(ALIS_FIYAT1_TextChanged);
         ALIS_FIYAT1.Text         = "0,00";
         afLastText = ALIS_FIYAT1.Text;
         ALIS_FIYAT1.TextChanged += new EventHandler(ALIS_FIYAT1_TextChanged);
     }
 }
Example #2
0
 private void PUAN_TextChanged(object sender, EventArgs e)
 {
     if (PUAN.Text != "")
     {
         PUAN.TextChanged -= new EventHandler(PUAN_TextChanged);
         if (PUAN.Text.Contains(","))
         {
             if (Goto724Lib.AfterChr(PUAN.Text, ',').Length > 2)
             {
                 PUAN.Text           = puanLastText;
                 PUAN.SelectionStart = PUAN.Text.Length;
                 PUAN.TextChanged   += new EventHandler(PUAN_TextChanged);
                 return;
             }
             else if (Goto724Lib.BeforeChr(PUAN.Text, ',').Length == 0)
             {
                 PUAN.Text = "0," + Goto724Lib.BeforeChr(PUAN.Text, ',');
             }
             else
             {
                 double numeric = Convert.ToDouble(Goto724Lib.RemoveChar(Goto724Lib.BeforeChr(PUAN.Text, ','), '.'));
                 PUAN.Text = numeric.ToString("#,0") + "," + Goto724Lib.AfterChr(PUAN.Text, ',');
             }
         }
         else
         {
             double doubleVal = Convert.ToDouble(Goto724Lib.RemoveChar(PUAN.Text, '.'));
             PUAN.Text = doubleVal.ToString("#,0");
         }
         puanLastText        = PUAN.Text;
         PUAN.SelectionStart = PUAN.Text.Length;
         PUAN.TextChanged   += new EventHandler(PUAN_TextChanged);
     }
 }
Example #3
0
        private void SATIS_FIYAT1_Leave(object sender, EventArgs e)
        {
            if (SATIS_FIYAT1.Text != "")
            {
                SATIS_FIYAT1.TextChanged -= new EventHandler(SATIS_FIYAT1_TextChanged);
                double doubleVal = Convert.ToDouble(Goto724Lib.RemoveChar(SATIS_FIYAT1.Text, '.'));
                if (doubleVal == 0.0)
                {
                    SATIS_FIYAT1.Text = "";
                }
                else
                {
                    string decimalStr = "";
                    for (int i = 0; i < 2; i++)
                    {
                        decimalStr += "0";
                    }
                    SATIS_FIYAT1.Text = doubleVal.ToString("#,0." + decimalStr);
                }
                sfLastText = SATIS_FIYAT1.Text;
                SATIS_FIYAT1.SelectionStart = SATIS_FIYAT1.Text.Length;
                SATIS_FIYAT1.TextChanged   += new EventHandler(SATIS_FIYAT1_TextChanged);
            }
            else
            {
                SATIS_FIYAT1.TextChanged -= new EventHandler(SATIS_FIYAT1_TextChanged);
                SATIS_FIYAT1.Text         = "0,00";
                sfLastText = SATIS_FIYAT1.Text;
                SATIS_FIYAT1.TextChanged += new EventHandler(SATIS_FIYAT1_TextChanged);
            }

            GrdStokIskDuzenle();
        }
Example #4
0
 public Image GetImage(string fieldName)
 {
     if (GetString(fieldName) != "")
     {
         return(Goto724Lib.ByteArrayToImage(dataSet.Tables[0].Rows[serviceIndex][fieldName] as byte[]));
     }
     return(null);
 }
Example #5
0
 private void BtnResimAdd_Click(object sender, EventArgs e)
 {
     if (!Goto724Lib.isNoImage(PROMOSYON_RESIM.Image))
     {
         PROMOSYON_RESIM.Image = Goto724Lib.noImage;
         lblResimSayac.Text    = (imageList.Count + 1) + "/" + (imageList.Count + 1);
         imageIndex            = imageList.Count;
     }
 }
Example #6
0
 private void GrdStokIskDuzenle()
 {
     foreach (DataGridViewRow row in grdStokFiyat.Rows)
     {
         double satisFiyat = Convert.ToDouble(Goto724Lib.RemoveChar(SATIS_FIYAT1.Text, '.'));
         double newFiyat   = Convert.ToDouble(Goto724Lib.RemoveChar(row.Cells["grdFiyat"].Value.ToString(), '.'));
         if (newFiyat != 0.0 && satisFiyat != 0.0)
         {
             row.Cells["grdIskonto"].Value = (((satisFiyat - newFiyat) * 100) / satisFiyat) / 100.0;
         }
         else
         {
             row.Cells["grdIskonto"].Value = 0.0;
         }
     }
 }
Example #7
0
 private void GrdStokFiyat_CellEndEdit(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.ColumnIndex == 1)
         {
             if (grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value != null && grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value.ToString() != "")
             {
                 grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value = Convert.ToDouble(grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value.ToString());
                 if (SATIS_FIYAT1.Text != "")
                 {
                     double satisFiyat = Convert.ToDouble(Goto724Lib.RemoveChar(SATIS_FIYAT1.Text, '.'));
                     double newFiyat   = Convert.ToDouble(Goto724Lib.RemoveChar(grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value.ToString(), '.'));
                     grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value = (((satisFiyat - newFiyat) * 100) / satisFiyat) / 100.0;
                 }
             }
             else
             {
                 grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value   = 0;
                 grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value = 0;
             }
         }
         else if (e.ColumnIndex == 2)
         {
             if (grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value != null && grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value.ToString() != "")
             {
                 grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value = Convert.ToDouble(grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value.ToString()) / 100.0;
                 if (SATIS_FIYAT1.Text != "")
                 {
                     double satisFiyat = Convert.ToDouble(Goto724Lib.RemoveChar(SATIS_FIYAT1.Text, '.'));
                     double newIsk     = Convert.ToDouble(Goto724Lib.RemoveChar(grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value.ToString(), '.'));
                     grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value = satisFiyat - (satisFiyat * newIsk);
                 }
             }
             else
             {
                 grdStokFiyat.Rows[e.RowIndex].Cells["grdFiyat"].Value   = 0;
                 grdStokFiyat.Rows[e.RowIndex].Cells["grdIskonto"].Value = 0;
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #8
0
        private void MusteriKod()
        {
            WebService musteriKoduQry = new WebService();

            musteriKoduQry.SQLText = "SELECT SON_NUMARA FROM TBLOTONUM WHERE NUMARA_KODU = '" + DateTime.Now.ToString("yyMM") + "_MUSTERI_KODU'";
            musteriKoduQry.Open();
            if (musteriKoduQry.DataCount() > 0)
            {
                int no = Convert.ToInt32(musteriKoduQry.GetString("SON_NUMARA"));
                MUSTERI_KOD.Text = DateTime.Now.ToString("yyMM") + Goto724Lib.AddStart((no + 1).ToString(), '0', 6);
            }
            else
            {
                MUSTERI_KOD.Text = DateTime.Now.ToString("yyMM") + "000001";
                yeniNum          = true;
            }
            yeniMusteriKod = MUSTERI_KOD.Text;
        }
Example #9
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (!Goto724Lib.isNoImage(PROMOSYON_RESIM.Image))
     {
         imageList.RemoveAt(imageIndex);
         if (imageList.Count == 0)
         {
             PROMOSYON_RESIM.Image = Goto724Lib.noImage;
             imageIndex            = 0;
             lblResimSayac.Text    = "1/1";
         }
         else
         {
             imageIndex--;
             PROMOSYON_RESIM.Image = imageList[imageIndex];
             lblResimSayac.Text    = (imageIndex + 1) + "/" + imageList.Count;
         }
     }
 }
Example #10
0
 private void PUAN_Leave(object sender, EventArgs e)
 {
     if (PUAN.Text != "")
     {
         PUAN.TextChanged -= new EventHandler(PUAN_TextChanged);
         double doubleVal = Convert.ToDouble(Goto724Lib.RemoveChar(PUAN.Text, '.'));
         if (doubleVal == 0.0)
         {
             PUAN.Text = "";
         }
         else
         {
             string decimalStr = "";
             for (int i = 0; i < 2; i++)
             {
                 decimalStr += "0";
             }
             PUAN.Text = doubleVal.ToString("#,0." + decimalStr);
         }
         puanLastText        = PUAN.Text;
         PUAN.SelectionStart = PUAN.Text.Length;
         PUAN.TextChanged   += new EventHandler(PUAN_TextChanged);
     }
 }
Example #11
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 #12
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            if (PAKET_KODU.Text != "" && PAKET_TANIMI.Text != "" && STOK_KODU.GetString() != "" && BIRIM_KODU.Text != "" && MIKTAR.Text != "")
            {
                WebService kntlService = new WebService();
                kntlService.SQLText = "SELECT PAKET_KODU FROM TBLSTOKPAKET WHERE PAKET_KODU = '" + PAKET_KODU.Text + "' AND TEDARIKCI_KODU = '" + Goto724Lib.tedarikciKodu + "' AND STOK_KODU = '" + STOK_KODU.GetString() + "'";
                kntlService.Open();
                if (kntlService.DataCount() > 0)
                {
                    string updStr = "UPDATE TBLSTOKPAKET SET ACIKLAMA = '" + PAKET_TANIMI.Text + "'";

                    updStr += ", STOK_KODU = '" + STOK_KODU.GetString() + "'";
                    updStr += ", BIRIM_KODU = '" + BIRIM_KODU.Text + "'";
                    updStr += ", MIKTAR = " + Goto724Lib.RemoveChar(MIKTAR.Text, '.').Replace(',', '.');

                    updStr += " WHERE PAKET_KODU = '" + PAKET_KODU.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 insStr = "INSERT INTO TBLSTOKPAKET(PAKET_KODU, ACIKLAMA, STOK_KODU, BIRIM_KODU, MIKTAR, TEDARIKCI_KODU)";
                    insStr += "VALUES ('" + PAKET_KODU.Text + "', '" + PAKET_TANIMI.Text + "', '" + STOK_KODU.GetString() + "', '" + BIRIM_KODU.Text + "', '" + Goto724Lib.RemoveChar(MIKTAR.Text, '.').Replace(',', '.') + "', '" + Goto724Lib.tedarikciKodu + "')";

                    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 (PAKET_KODU.Text == "")
                {
                    mesaj = "Paket Kodu";
                }
                else if (PAKET_TANIMI.Text == "")
                {
                    mesaj = "Paket Tanımı";
                }
                else if (STOK_KODU.GetString() == "")
                {
                    mesaj = "Stok Kodu";
                }
                else if (BIRIM_KODU.Text == "")
                {
                    mesaj = "Birim";
                }
                else if (MIKTAR.Text == "")
                {
                    mesaj = "Miktar";
                }
                else if (SATIS_FIYAT.Text == "")
                {
                    mesaj = "Satış Fiyatı";
                }
                mesaj += " Boş Olamaz";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }
Example #13
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);
            }
        }
Example #14
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);
            }
        }
Example #15
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (MUSTERI_KOD.Text != "" && MUSTERI_AD.Text != "")
            {
                WebService kntlService = new WebService();
                kntlService.SQLText = "SELECT MUSTERI_KODU FROM TBLMUSTERI WHERE MUSTERI_KODU = '" + MUSTERI_KOD.Text + "'";
                kntlService.Open();
                if (kntlService.DataCount() > 0)
                {
                    string updStr = "UPDATE TBLMUSTERI SET MUSTERI_ADI = '" + MUSTERI_AD.Text + "'";

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

                    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 (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 (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 (ULKE.Text != "")
                    {
                        updStr += ", ULKE = '" + ULKE.Text + "'";
                    }
                    else
                    {
                        updStr += ", ULKE = NULL";
                    }

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

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

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

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

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

                    updStr += " WHERE MUSTERI_KODU = '" + MUSTERI_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 insStr = "INSERT INTO TBLMUSTERI(MUSTERI_KODU, MUSTERI_ADI, MUSTERI_TIPI, UST_NO, CADDE_SOKAK, TEL_NO, CEP_TEL, E_POSTA, WEB_SITE, BINA_NO, SEHIR, POSTA_KODU, ULKE, FIRMA, ISLETME_ADI, FAX, PASIF_MI, MUSTERI_NOTU, KAYIT_YAPAN)";
                    insStr += "VALUES ('" + MUSTERI_KOD.Text + "', '" + MUSTERI_AD.Text + "'";

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

                    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 (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 (FIRMA.Text != "")
                    {
                        insStr += ", '" + FIRMA.Text + "'";
                    }
                    else
                    {
                        insStr += ", NULL";
                    }

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

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

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

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

                    if (Goto724Lib.adminMi == true)
                    {
                        insStr += ", 'Admin'";
                    }
                    else
                    {
                        insStr += ", '" + Goto724Lib.tedarikciKodu + "'";
                    }

                    insStr += ")";

                    WebService service = new WebService();
                    service.SQLText = insStr;
                    service.Open();
                    if (service.errorCode == "0")
                    {
                        WebService otonumQry = new WebService();
                        if (yeniNum)
                        {
                            otonumQry.SQLText = "INSERT INTO TBLOTONUM(NUMARA_KODU, SON_NUMARA) VALUES('" + DateTime.Now.ToString("yyMM") + "_MUSTERI_KODU', '" + Convert.ToInt32(Goto724Lib.LastDigits(MUSTERI_KOD.Text, 6)) + "')";
                        }
                        else
                        {
                            otonumQry.SQLText = "UPDATE TBLOTONUM SET SON_NUMARA = '" + Convert.ToInt32(Goto724Lib.LastDigits(MUSTERI_KOD.Text, 6)) + "' WHERE NUMARA_KODU = '" + DateTime.Now.ToString("yyMM") + "_MUSTERI_KODU'";
                        }
                        otonumQry.Open();

                        MusteriKod();

                        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 (MUSTERI_KOD.Text == "")
                {
                    mesaj = "Müşteri Kodu";
                }
                else if (MUSTERI_AD.Text == "")
                {
                    mesaj = "Müşteri Adı";
                }
                mesaj += " Boş Olamaz!!";
                GotoMessage.ShowMessage("Bilgi", mesaj);
            }
        }
Example #16
0
        private void btnGirisYap_Click(object sender, EventArgs e)
        {
            if (!lisansKontrol)
            {
                if (KULLANICI_ADI.Text != "" && KULLANICI_SIFRE.Text != "")
                {
                    if (KULLANICI_ADI.Text == "19010100001" && KULLANICI_SIFRE.Text == "Goto724")
                    {
                        try
                        {
                            var path = Path.GetDirectoryName(Application.ExecutablePath) + "\\goto.cfg";
                            using (var tw = new StreamWriter(path, true))
                            {
                                tw.WriteLine(Goto724Lib.Sifrele(KULLANICI_ADI.Text));
                                tw.WriteLine(Goto724Lib.Sifrele(KULLANICI_SIFRE.Text));
                            }

                            Goto724Lib.lisansNumarasi = KULLANICI_ADI.Text;
                            Goto724Lib.lisansSifresi  = KULLANICI_SIFRE.Text;
                            Goto724Lib.adminMi        = true;

                            lblKullaniciAdi.Text  = "Kullanıcı Adı";
                            lblSifre.Text         = "Şifre";
                            btnGirisYap.Text      = "Giriş Yap";
                            KULLANICI_ADI.Text    = "";
                            KULLANICI_SIFRE.Text  = "";
                            cbBeniHatirla.Visible = true;

                            lisansKontrol = true;

                            GotoMessage.ShowMessage("Bilgi", "Admin Lisans Kaydı Başarıyla Tamamlandı.");
                        }
                        catch (Exception ex)
                        {
                            GotoMessage.ShowMessage("Hata", "Lisans Kaydında Hata Oluştu");
                        }
                    }
                    else
                    {
                        WebService lisansService = new WebService();
                        lisansService.SQLText = "SELECT TEDARIKCI_KODU FROM TBLTEDARIKCI WHERE LISANS_NUMARASI = '" + KULLANICI_ADI.Text + "' AND LISANS_SIFRESI = '" + KULLANICI_SIFRE.Text + "'";
                        lisansService.Open();
                        if (lisansService.DataCount() > 0)
                        {
                            try
                            {
                                var path = Path.GetDirectoryName(Application.ExecutablePath) + "\\goto.cfg";
                                using (var tw = new StreamWriter(path, true))
                                {
                                    tw.WriteLine(Goto724Lib.Sifrele(KULLANICI_ADI.Text));
                                    tw.WriteLine(Goto724Lib.Sifrele(KULLANICI_SIFRE.Text));
                                }
                                Goto724Lib.tedarikciKodu  = lisansService.GetString("TEDARIKCI_KODU");
                                Goto724Lib.lisansNumarasi = KULLANICI_ADI.Text;
                                Goto724Lib.lisansSifresi  = KULLANICI_SIFRE.Text;

                                lblKullaniciAdi.Text  = "Kullanıcı Adı";
                                lblSifre.Text         = "Şifre";
                                btnGirisYap.Text      = "Giriş Yap";
                                KULLANICI_ADI.Text    = "";
                                KULLANICI_SIFRE.Text  = "";
                                cbBeniHatirla.Visible = true;

                                lisansKontrol = true;

                                GotoMessage.ShowMessage("Bilgi", "Lisans Kaydı Başarıyla Tamamlandı.");

                                btnTeklifAl.Visible  = true;
                                btnTeklifVer.Visible = true;
                                pnlTeklifAl.Visible  = true;
                                pnlTeklifVer.Visible = true;
                                Size = new Size(851, Size.Height);
                            }
                            catch (Exception ex)
                            {
                                GotoMessage.ShowMessage("Hata", "Lisans Kaydında Hata Oluştu");
                            }
                        }
                        else
                        {
                            GotoMessage.ShowMessage("Hata", "Lisans Bilgileri Hatalıdır.");
                        }
                    }
                }
                else
                {
                    string mesaj = "";
                    if (KULLANICI_ADI.Text == "")
                    {
                        mesaj = "Lisans Numarası";
                    }
                    else if (KULLANICI_SIFRE.Text == "")
                    {
                        mesaj = "Lisans Şifresi";
                    }
                    mesaj += " Boş Olamaz!!";
                    GotoMessage.ShowMessage("Bilgi", mesaj);
                }
            }
            else
            {
                if (KULLANICI_ADI.Text != "" && KULLANICI_SIFRE.Text != "")
                {
                    WebService kullaniciService = new WebService();
                    kullaniciService.SQLText = "SELECT KULLANICI_NO FROM TBLKULLANICI WHERE KULLANICI_ADI = '" + KULLANICI_ADI.Text + "' AND SIFRE = '" + KULLANICI_SIFRE.Text + "' AND LISANS_NUMARASI = '" + Goto724Lib.lisansNumarasi + "'";
                    kullaniciService.Open();
                    if (kullaniciService.DataCount() > 0)
                    {
                        Goto724Lib.lang = DIL.SelectedIndex;
                        if (cbBeniHatirla.Checked)
                        {
                            try
                            {
                                var path = Path.GetDirectoryName(Application.ExecutablePath) + "\\goto.cfg";
                                System.IO.File.WriteAllText(path, string.Empty);
                                using (var tw = new StreamWriter(path, true))
                                {
                                    tw.WriteLine(Goto724Lib.Sifrele(Goto724Lib.lisansNumarasi));
                                    tw.WriteLine(Goto724Lib.Sifrele(Goto724Lib.lisansSifresi));
                                    tw.WriteLine(Goto724Lib.Sifrele(KULLANICI_ADI.Text));
                                    tw.WriteLine(Goto724Lib.Sifrele(KULLANICI_SIFRE.Text));
                                    tw.WriteLine(DIL.SelectedIndex + "");
                                }
                            }
                            catch (Exception ex)
                            {
                            }
                        }

                        Goto724Lib.kullaniciAdi = KULLANICI_ADI.Text;
                        Goto724Lib.sifre        = KULLANICI_SIFRE.Text;
                        Goto724Lib.kullaniciNo  = kullaniciService.GetString("KULLANICI_NO");

                        this.Close();
                        Thread th = new Thread(OpenAnaMenu);
                        th.SetApartmentState(ApartmentState.STA);
                        th.Start();
                    }
                    else
                    {
                        GotoMessage.ShowMessage("Hata", "Kullanıcı Bilgileri Hatalıdır.");
                    }
                }
                else
                {
                    string mesaj = "";
                    if (KULLANICI_ADI.Text == "")
                    {
                        mesaj = "Kullanıcı Adı";
                    }
                    else if (KULLANICI_SIFRE.Text == "")
                    {
                        mesaj = "Şifre";
                    }
                    mesaj += " Boş Olamaz!!";
                    GotoMessage.ShowMessage("Bilgi", mesaj);
                }
            }
        }
Example #17
0
        private void Login_Load(object sender, EventArgs e)
        {
            DIL.SelectedIndex = 0;
            var path = Path.GetDirectoryName(Application.ExecutablePath) + "\\goto.cfg";

            if (File.Exists(path))
            {
                string[] lines = System.IO.File.ReadAllLines(path);
                if (lines.Length >= 2)
                {
                    string lisansNumarasi = Goto724Lib.SifreCoz(lines[0]);
                    string lisansSifresi  = Goto724Lib.SifreCoz(lines[1]);
                    string kullaniciAdi   = "";
                    string kullaniciSifre = "";
                    int    lang           = 0;

                    if (lines.Length >= 4)
                    {
                        kullaniciAdi   = Goto724Lib.SifreCoz(lines[2]);
                        kullaniciSifre = Goto724Lib.SifreCoz(lines[3]);
                    }
                    if (lines.Length >= 5)
                    {
                        if (lines[4] == "1")
                        {
                            DIL.SelectedIndex    = 1;
                            lblKullaniciAdi.Text = lblKullaniciAdi.GerText;
                            lblSifre.Text        = lblSifre.GerText;
                            lblDil.Text          = lblDil.GerText;
                        }
                    }

                    if (lisansNumarasi == "19010100001" && lisansSifresi == "Goto724")
                    {
                        Goto724Lib.adminMi        = true;
                        lisansKontrol             = true;
                        Goto724Lib.lisansNumarasi = lisansNumarasi;
                        Goto724Lib.lisansSifresi  = lisansSifresi;

                        KULLANICI_ADI.Text   = kullaniciAdi;
                        KULLANICI_SIFRE.Text = kullaniciSifre;
                    }
                    else
                    {
                        WebService lisansService = new WebService();
                        lisansService.SQLText = "SELECT TEDARIKCI_KODU, TEDARIKCI_RESIM FROM TBLTEDARIKCI WHERE LISANS_NUMARASI = '" + lisansNumarasi + "' AND LISANS_SIFRESI = '" + lisansSifresi + "'";
                        lisansService.Open();
                        if (lisansService.DataCount() > 0)
                        {
                            Goto724Lib.tedarikciKodu  = lisansService.GetString("TEDARIKCI_KODU");
                            Goto724Lib.lisansNumarasi = lisansNumarasi;
                            Goto724Lib.lisansSifresi  = lisansSifresi;
                            lisansKontrol             = true;

                            if (lisansService.GetString("TEDARIKCI_RESIM") != "")
                            {
                                pbTedResim.Image = lisansService.GetImage("TEDARIKCI_RESIM");
                            }

                            KULLANICI_ADI.Text   = kullaniciAdi;
                            KULLANICI_SIFRE.Text = kullaniciSifre;
                        }
                        else
                        {
                            System.IO.File.WriteAllText(path, string.Empty);
                            GotoMessage.ShowMessage("Hata", "Lisans Bilgilerinde Hata Mevcut.");
                        }
                    }
                }
            }

            if (!lisansKontrol)
            {
                lblKullaniciAdi.Text  = "Lisans Numarası";
                lblSifre.Text         = "Lisans Şifresi";
                btnGirisYap.Text      = "Kayıt Ol";
                cbBeniHatirla.Visible = false;

                btnTeklifAl.Visible  = false;
                btnTeklifVer.Visible = false;
                pnlTeklifAl.Visible  = false;
                pnlTeklifVer.Visible = false;

                Size = new Size(513, Size.Height);
            }
            else
            {
                if (Goto724Lib.adminMi)
                {
                    btnTeklifAl.Visible  = false;
                    btnTeklifVer.Visible = false;
                    pnlTeklifAl.Visible  = false;
                    pnlTeklifVer.Visible = false;

                    Size = new Size(513, Size.Height);
                }
                else
                {
                    //using (ProgressForm frm = new ProgressForm(Teklifler))
                    //{
                    //    frm.activeForm = this;
                    //    frm.processID = 1;
                    //    frm.ShowDialog();
                    //}
                }
            }
        }
Example #18
0
        private void AnaMenu_Load(object sender, EventArgs e)
        {
            if (Goto724Lib.lang == 1)
            {
                elementTedarikciler.Text        = "";
                elementSiparisler.Text          = "Bestellungen";
                elementTumSip.Text              = "Alle Bestellungen";
                elementAppSip.Text              = "App. Kunden Bestellungen";
                elementManuelSip.Text           = "Manuel Kunden Bestellungen";
                elementUretimPlanlama.Text      = "Produktion Plannen";
                elementKargoPlanlama.Text       = "Lieferung Plannen";
                elementTedOneri.Text            = "Lieferanten Empfählungen";
                elementStoklar.Text             = "Produkten";
                elementStokKayit.Text           = "Produkten Eingabe";
                elementStokTipKayit.Text        = "Produktart Eingabe";
                elementStokPaketKayit.Text      = "Produktverpackung Eingabe";
                elementMusteriler.Text          = "Kundem";
                elementMusteriKartlari.Text     = "Kunden Kartei";
                elementMusteriPuanlari.Text     = " Kunden Punkten";
                elementHesabım.Text             = "Mein Konto";
                elementHesabımıDuzenle.Text     = "Konto Einstellung";
                elementFaturalar.Text           = "Rechnungen D724";
                elementFaturalarim.Text         = "Meine Rechnungen";
                elementFaturaRapor.Text         = "Rechnung Reporten";
                elementTeklifler.Text           = "Angeboten";
                elementSatiyorum.Text           = "Verkaufen";
                elementSatinAlmakIstiyorum.Text = "Einkaufen";
                elementTekliflereGit.Text       = "Angebotenübersicht";
                elementMusFatOpsiyonel.Text     = "Kunden Rechnungen Optionel";
                elementUrunStokTakip.Text       = "Herstellung-Lager Programm";
                elementAyarlar.Text             = "Einstellungen";
                elementAyarlariDuzenle.Text     = "Einstellen";
                elementCikis.Text = "Auslogen";
            }

            Goto724Lib.anaForm = this;
            foreach (Control ctrl in Controls)
            {
                if (ctrl is MdiClient)
                {
                    Goto724Lib.mdiClient = (ctrl as MdiClient);
                    break;
                }
            }

            if (Goto724Lib.adminMi)
            {
                //pnlSiparisler.Visible = false;
                //pnlStoklar.Visible = false;
                ////pnlMusteriler.Visible = false;
                //pnlAyarlar.Visible = false;
                //pnlHesabım.Visible = false;
                //pnlFaturalarTed.Visible = false;
                //pnlTeklifler.Visible = false;
                //pnlMusFaturalari.Visible = false;
                //pnlUrunStokTakip.Visible = false;

                elementSiparisler.Visible        = false;
                elementStoklar.Visible           = false;
                elementAyarlar.Visible           = false;
                elementHesabım.Visible           = false;
                elementFaturalar.Visible         = false;
                elementTeklifler.Visible         = false;
                elementMusteriFaturalari.Visible = false;
                elementUrunStokTakip.Visible     = false;
                elementTedOneri.Visible          = false;
            }
            else
            {
                //pnlTedarikciler.Visible = false;
                //pnlKategoriler.Visible = false;
                //pnlPromosyonlar.Visible = false;
                //lblTedarikciListesi.Visible = false;
                //lblMusteriListesi.Visible = false;
                //lblTedarikciDurumRaporu.Visible = false;
                //lblPromosyonListesi.Visible = false;
                //pnlRaporlar.Visible = false;
                //pnlFaturalar.Visible = false;

                //pnlRaporlar.Size = new Size(pnlRaporlar.Size.Width, 70);

                elementTedarikciler.Visible   = false;
                elementKategoriler.Visible    = false;
                elementPromosyonlar.Visible   = false;
                elementTedListe.Visible       = false;
                elementMusListe.Visible       = false;
                elementTedDurumRaporu.Visible = false;
                elementRaporlar.Visible       = false;
                elementPromosyonListe.Visible = false;
                elementAdminFaturalar.Visible = false;
            }
            lblKullaniciNo.Text    = Goto724Lib.kullaniciNo + "/" + Goto724Lib.kullaniciAdi;
            lblLisansNumarasi.Text = Goto724Lib.lisansNumarasi;
            if (!Goto724Lib.adminMi)
            {
                lblTedarikciNo.Text = Goto724Lib.tedarikciKodu;
            }
            else
            {
                lblTedarikciNo.Visible = false;
            }

            Goto724Lib.ReadParameters();

            Control.CheckForIllegalCrossThreadCalls = false;
            onlineCheckThread = new Thread(new ThreadStart(OnlineCheck));
            onlineCheckThread.Start();
        }
Example #19
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 #20
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);
            }
        }