コード例 #1
0
ファイル: UrunListeleri.cs プロジェクト: al-ammari/E-ticaret
 public DataTable ListeSliderUrunleri()
 {
     try
     {
         return(db.ExecuteDataSet(CommandType.Text, "SELECT U.ID,U.MODEL,(SELECT R.RESIMADI FROM TBLURUN_RESIMLERI R WHERE R.URUNID=U.ID AND R.SLIDERRESIM=" + (short)eEvetHayir.Evet + ")RESIM_ADI from TBLURUNLER U WHERE U.SLIDER=" + (short)eEvetHayir.Evet + " AND U.AKTIF=" + (short)eAktifDurum.Aktif).Tables[0]);
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(null);
     }
 }
コード例 #2
0
 public int RaporEkle(TBLRAPOR ptRapor)
 {
     try
     {
         DbCommand dbcommand = db.GetSqlStringCommand("INSERT INTO TBLRAPOR(AD,YOL) VALUES(@AD,@YOL) SELECT @@IDENTITY");
         db.AddInParameter(dbcommand, "AD", DbType.String, ptRapor.AD);
         db.AddInParameter(dbcommand, "YOL", DbType.String, ptRapor.YOL);
         return(db.ExecuteScalar(dbcommand).ToInt(0));
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(0);
     }
 }
コード例 #3
0
ファイル: UIAraclari.cs プロジェクト: al-ammari/E-ticaret
        public static decimal KurDegeri(ETicaretIslemleri.eParaBirimi peParaBirimi)
        {
            try
            {
                XmlTextReader okuyucu = new XmlTextReader("http://www.tcmb.gov.tr/kurlar/today.xml"); // xml imizin yolu...
                XmlDocument   dokuman = new XmlDocument();
                dokuman.Load(okuyucu);                                                                // okuyucu değişkenimdeki xml'in yolunu oku...

                XmlNode dolar = dokuman.SelectSingleNode("/Tarih_Date/Currency[CurrencyName='US DOLLAR']");
                XmlNode euro  = dokuman.SelectSingleNode("/Tarih_Date/Currency[CurrencyName='EURO']");
                //euro_alis = double.Parse(euro.ChildNodes[3].InnerText, new System.Globalization.CultureInfo("en-US"));
                //dolar_alis = double.Parse(dolar.ChildNodes[3].InnerText, new System.Globalization.CultureInfo("en-US"));;
                System.Globalization.NumberFormatInfo nfi = new System.Globalization.CultureInfo("en-US", false).NumberFormat;
                nfi.CurrencyDecimalDigits = 2;
                if (peParaBirimi == ETicaretIslemleri.eParaBirimi.Dolar)
                {
                    return(Decimal.Parse(dolar.ChildNodes[4].InnerText, new System.Globalization.CultureInfo("en-US")));
                }
                else if (peParaBirimi == ETicaretIslemleri.eParaBirimi.Euro)
                {
                    return(Decimal.Parse(euro.ChildNodes[4].InnerText, new System.Globalization.CultureInfo("en-US")));
                }
                else
                {
                    return(1);
                }
            }
            catch (Exception ex)
            {
                cLog.Write(ex, _iKullaniciID);
                return(1);
            }
        }
コード例 #4
0
ファイル: Tahsilat.cs プロジェクト: al-ammari/E-ticaret
        public short EkleBanka(TBLBANKALAR ptBankalar)
        {
            try
            {
                DbCommand dbCommand = db.GetSqlStringCommand("INSERT INTO TBLBANKALAR(BANKA_ADI,KULLANICI_ADI,SIFRE,MAGAZA_NO,AKTIF,TAKSIT,HOST) VALUES(@BANKA_ADI,@KULLANICI_ADI,@SIFRE,@MAGAZA_NO,@AKTIF,@TAKSIT,@HOST) SELECT @@IDENTITY");
                db.AddInParameter(dbCommand, "BANKA_ADI", DbType.String, ptBankalar.BANKA_ADI);
                db.AddInParameter(dbCommand, "KULLANICI_ADI", DbType.String, ptBankalar.KULLANICI_ADI);
                db.AddInParameter(dbCommand, "SIFRE", DbType.String, ptBankalar.SIFRE);
                db.AddInParameter(dbCommand, "MAGAZA_NO", DbType.String, ptBankalar.MAGAZA_NO);
                db.AddInParameter(dbCommand, "AKTIF", DbType.Int16, (short)ptBankalar.AKTIF);
                db.AddInParameter(dbCommand, "TAKSIT", DbType.Int16, (short)ptBankalar.TAKSIT);
                db.AddInParameter(dbCommand, "HOST", DbType.String, ptBankalar.HOST);

                return(db.ExecuteScalar(dbCommand).ToShort(0));
            }
            catch (Exception ex)
            {
                cLog.Write(ex, _iKullaniciID);
                return(0);
            }
        }
コード例 #5
0
 /// <summary>
 /// ilk başta kargo bilgisi ve değişme bilgisieklenmez
 /// </summary>
 /// <param name="ptSiparis"></param>
 /// <returns></returns>
 public long EkleSparis(TBLSIPARIS ptSiparis)
 {
     try
     {
         DbCommand dbCommand = db.GetSqlStringCommand("INSERT INTO TBLSIPARIS(UYEID,FATURA_ADI, FATURA_VERGINO,TUTAR,ADRES,BANKAID,SPOSSONUC,ODEMETIPI,SIPARISDURUMU,OLUSMA_ZAMANI,GUID) VALUES(@UYEID,@FATURA_ADI,@FATURA_VERGINO,@TUTAR,@ADRES,@BANKAID,@SPOSSONUC, @ODEMETIPI, @SIPARISDURUMU, @OLUSMA_ZAMANI,@GUID) SELECT @@IDENTITY");
         db.AddInParameter(dbCommand, "UYEID", DbType.Int32, ptSiparis.UYEID);
         db.AddInParameter(dbCommand, "FATURA_ADI", DbType.String, ptSiparis.FATURA_ADI);
         db.AddInParameter(dbCommand, "FATURA_VERGINO", DbType.String, ptSiparis.FATURA_VERGINO);
         db.AddInParameter(dbCommand, "TUTAR", DbType.Decimal, ptSiparis.TUTAR);
         db.AddInParameter(dbCommand, "ADRES", DbType.String, ptSiparis.ADRES);
         db.AddInParameter(dbCommand, "BANKAID", DbType.Int16, ptSiparis.BANKAID);
         db.AddInParameter(dbCommand, "SPOSSONUC", DbType.String, ptSiparis.SPOSSONUC);
         db.AddInParameter(dbCommand, "ODEMETIPI", DbType.Int16, (short)ptSiparis.ODEMETIPI);
         db.AddInParameter(dbCommand, "SIPARISDURUMU", DbType.Int16, (short)ptSiparis.SIPARISDURUMU);
         db.AddInParameter(dbCommand, "OLUSMA_ZAMANI", DbType.DateTime, DateTime.Now);
         db.AddInParameter(dbCommand, "GUID", DbType.String, Guid.NewGuid().ToString());
         return(db.ExecuteScalar(dbCommand).ToLong(0));
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(0);
     }
 }
コード例 #6
0
 /// <summary>
 /// Şehirler listelenir.
 /// </summary>
 /// <param name="piID">0 ise tümü listelenir şehrin ID si yzılırsa sadece o ID li şehir yazılır</param>
 /// <returns></returns>
 public DataTable ListeleSehirler(int piID)
 {
     try
     {
         string strSorgu = string.Empty;
         if (piID > 0)
         {
             strSorgu = " WHERE ID=" + piID;
         }
         return(db.ExecuteDataSet(CommandType.Text, "SELECT * FROM TBLSEHIR" + strSorgu + " ORDER BY KODU ASC").Tables[0]);
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(null);
     }
 }
コード例 #7
0
 public int EkleKullanici(TBLUYELER ptUyeler)
 {
     try
     {
         DbCommand dbcommand = db.GetSqlStringCommand("INSERT INTO TBLUYELER(ADI,SOYADI,EMAIL,SIFRE,DOGUM_TARIHI,CINSIYET,ADRES,SEHIR_ID,CEPTELEFONU,EVTELEFONU,KULLANICI_TIPI,GUID,OLUSMA_ZAMANI) VALUES(@ADI,@SOYADI,@EMAIL,@SIFRE,@DOGUM_TARIHI,@CINSIYET,@ADRES,@SEHIR_ID,@CEPTELEFONU,@EVTELEFONU,@KULLANICI_TIPI, @GUID,@OLUSMA_ZAMANI) SELECT @@IDENTITY");
         db.AddInParameter(dbcommand, "ADI", DbType.String, ptUyeler.ADI);
         db.AddInParameter(dbcommand, "SOYADI", DbType.String, ptUyeler.SOYADI);
         db.AddInParameter(dbcommand, "EMAIL", DbType.String, ptUyeler.EMAIL);
         db.AddInParameter(dbcommand, "SIFRE", DbType.String, ptUyeler.SIFRE.ToMD5());
         db.AddInParameter(dbcommand, "DOGUM_TARIHI", DbType.DateTime, ptUyeler.DOGUM_TARIHI);
         db.AddInParameter(dbcommand, "CINSIYET", DbType.Int16, (short)ptUyeler.CINSIYET);
         db.AddInParameter(dbcommand, "ADRES", DbType.String, ptUyeler.ADRES);
         db.AddInParameter(dbcommand, "SEHIR_ID", DbType.Int32, ptUyeler.SEHIR_ID);
         db.AddInParameter(dbcommand, "CEPTELEFONU", DbType.String, ptUyeler.CEPTELEFONU);
         db.AddInParameter(dbcommand, "EVTELEFONU", DbType.String, ptUyeler.EVTELEFONU);
         db.AddInParameter(dbcommand, "KULLANICI_TIPI", DbType.Int16, (short)ptUyeler.KULLANICI_TIPI);
         db.AddInParameter(dbcommand, "GUID", DbType.String, Guid.NewGuid().ToString());
         db.AddInParameter(dbcommand, "OLUSMA_ZAMANI", DbType.DateTime, DateTime.Now);
         return(db.ExecuteScalar(dbcommand).ToInt(0));
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(0);
     }
 }
コード例 #8
0
 public int EkleMarka(TBLMARKALAR ptMarkalar)
 {
     try
     {
         DbCommand dbcommand = db.GetSqlStringCommand("INSERT INTO TBLMARKALAR(KODU,ADI,LOGO,ACIKLAMA) VALUES(@KODU, @ADI,@LOGO,@ACIKLAMA) SELECT @@IDENTITY");
         db.AddInParameter(dbcommand, "KODU", DbType.String, ptMarkalar.KODU);
         db.AddInParameter(dbcommand, "ADI", DbType.String, ptMarkalar.ADI);
         db.AddInParameter(dbcommand, "LOGO", DbType.String, ptMarkalar.LOGO);
         db.AddInParameter(dbcommand, "ACIKLAMA", DbType.String, ptMarkalar.ACIKLAMA);
         return(db.ExecuteScalar(dbcommand).ToInt(0));
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(0);
     }
 }