コード例 #1
0
        public static Doviz GetDoviz(int pID)
        {
            Doviz rvDoviz = new Doviz();

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select top 1  * from Doviz where ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.Int);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvDoviz = new Doviz(MConvert.NullToInt(IDR["ID"]), MConvert.NullToString(IDR["Cinsi"]), MConvert.NullToFloat(IDR["Kuru"]), MConvert.NullToDateTime(IDR["Tarih"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvDoviz);
        }
コード例 #2
0
        public static VideoCollection GetSelect(System.Guid pHesapID)
        {
            VideoCollection rvVideo = new VideoCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM Video WHERE HesapID=@HesapID", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvVideo.Add(new Video(MConvert.NullToInt64(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["KategoriID"]), MConvert.NullToString(IDR["ResimUrl"]), MConvert.NullToString(IDR["Baslik"]), MConvert.NullToString(IDR["Embed"]), MConvert.NullToString(IDR["Etiket"]), MConvert.NullToDateTime(IDR["KayitTarihi"]), MConvert.NullToBool(IDR["Yorum"]), MConvert.NullToBool(IDR["Aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvVideo);
        }
コード例 #3
0
        ///<summary>
        /// Video Data Delete
        ///</summary>
        public static int Delete(Video p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "DELETE FROM Video WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.BigInt);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #4
0
        public static Int64 GetCount(Int64 panketid, string pip)
        {
            Int64 rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select count(ip) from anketpuan where anketid=?anketid and ip=?ip", conneciton))
                {
                    cmd.Parameters.Add("anketid", panketid, MSqlDbType.BigInt);
                    cmd.Parameters.Add("ip", pip, MSqlDbType.VarChar);
                    rowsAffected = BAYMYO.UI.Converts.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #5
0
        public static int Delete(AnketPuan p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "delete from anketpuan where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #6
0
        ///<summary>
        /// Sehir Data PrimaryKey
        ///</summary>
        public static Sehir GetSehir(byte pid)
        {
            Sehir rvSehir = new Sehir();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from sehir where id=?id limit 1", conneciton))
                {
                    cmd.Parameters.Add("id", pid, MSqlDbType.SmallInt);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvSehir = new Sehir(MConvert.NullToByte(IDR["id"]), MConvert.NullToString(IDR["adi"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvSehir);
        }
コード例 #7
0
        ///<summary>
        /// CalismaAlani Data Insert
        ///</summary>
        public static int Insert(CalismaAlani p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "if (@Varsayilan=1) begin UPDATE CalismaAlani SET Varsayilan=0 WHERE HesapID=@HesapID AND Varsayilan=1 end INSERT INTO CalismaAlani (HesapID,Kurum,Telefon,Adres,Semt,Sehir,WebSitesi,Randevu,Varsayilan,Aktif) VALUES(@HesapID,@Kurum,@Telefon,@Adres,@Semt,@Sehir,@WebSitesi,@Randevu,@Varsayilan,@Aktif)", conneciton))
                {
                    cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("Kurum", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(p.Kurum.ToLower().Trim()), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Telefon", p.Telefon, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adres", p.Adres, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Semt", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(p.Semt.ToLower().Trim()), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Sehir", p.Sehir.ToUpper().Trim(), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("WebSitesi", p.WebSitesi.Trim(), MSqlDbType.VarChar);
                    cmd.Parameters.Add("Randevu", p.Randevu, MSqlDbType.Bit);
                    cmd.Parameters.Add("Varsayilan", p.Varsayilan, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #8
0
        ///<summary>
        /// Gosterim Data Select
        ///</summary>
        public static GosterimCollection GetSelect()
        {
            GosterimCollection rvGosterim = new GosterimCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from gosterim", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvGosterim.Add(new Gosterim(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["modulid"]), MConvert.NullToString(IDR["icerikid"]), MConvert.NullToDateTime(IDR["kayittarihi"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvGosterim);
        }
コード例 #9
0
        ///<summary>
        /// Gosterim Data Update
        ///</summary>
        public static int Update(Gosterim p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update gosterim set hesapid=?hesapid,ip=?ip,modulid=?modulid,icerikid=?icerikid,kayittarihi=?kayittarihi where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("icerikid", p.IcerikID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #10
0
        ///<summary>
        /// Profil Data Update
        ///</summary>
        public static object Update(Profil p)
        {
            object rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.StoredProcedure, "Profil_Update", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("Url", p.Url, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ResimUrl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Unvan", p.Unvan, MSqlDbType.VarChar);
                    cmd.Parameters.Add("UzmanlikAlaniID", p.UzmanlikAlaniID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("TCKimlikNo", p.TCKimlikNo, MSqlDbType.VarChar);
                    cmd.Parameters.Add("DiplomaNo", p.DiplomaNo, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Hakkimda", p.Hakkimda, MSqlDbType.NVarChar);
                    rowsAffected = cmd.ExecuteScalar();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #11
0
        ///<summary>
        /// Gosterim Data PrimaryKey
        ///</summary>
        public static Gosterim GetGosterim(System.String pid)
        {
            Gosterim rvGosterim = new Gosterim();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from gosterim where id=?id limit 1", conneciton))
                {
                    cmd.Parameters.Add("id", pid, MSqlDbType.VarChar);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvGosterim = new Gosterim(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["modulid"]), MConvert.NullToString(IDR["icerikid"]), MConvert.NullToDateTime(IDR["kayittarihi"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvGosterim);
        }
コード例 #12
0
        public static Profil GetProfil(string pUrl)
        {
            Profil rvProfil = new Profil();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT TOP(1) * FROM Profil WHERE Url=@Url", conneciton))
                {
                    cmd.Parameters.Add("Url", pUrl, MSqlDbType.VarChar);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvProfil = new Profil(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToString(IDR["Url"]), MConvert.NullToString(IDR["ResimUrl"]), MConvert.NullToString(IDR["Unvan"]), MConvert.NullToString(IDR["UzmanlikAlaniID"]), MConvert.NullToString(IDR["TCKimlikNo"]), MConvert.NullToString(IDR["DiplomaNo"]), MConvert.NullToString(IDR["Adi"]), MConvert.NullToString(IDR["Mail"]), MConvert.NullToString(IDR["Hakkimda"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvProfil);
        }
コード例 #13
0
        public static int Update(Doviz p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "Update Doviz SET Cinsi=@Cinsi,Kuru=@Kuru,Tarih=@Tarih where ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("Cinsi", p.Cinsi.ToUpper(), MSqlDbType.VarChar);
                    cmd.Parameters.Add("Kuru", p.Kuru, MSqlDbType.Float);
                    cmd.Parameters.Add("Tarih", p.Tarih, MSqlDbType.DateTime);
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #14
0
        public static DovizCollection GetSelect()
        {
            DovizCollection rvDoviz = new DovizCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from Doviz", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvDoviz.Add(new Doviz(MConvert.NullToInt(IDR["ID"]), MConvert.NullToString(IDR["Cinsi"]), MConvert.NullToFloat(IDR["Kuru"]), MConvert.NullToDateTime(IDR["Tarih"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvDoviz);
        }
コード例 #15
0
        ///<summary>
        /// Sehir Data Insert
        ///</summary>
        public static int Insert(Sehir p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "insert into sehir (adi) values(?adi)", conneciton))
                {
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #16
0
        public static Stok GetStok(int pID)
        {
            Stok rvStok = new Stok();

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select top 1  * from Stok where ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.Int);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvStok = new Stok(MConvert.NullToInt(IDR["ID"]), MConvert.NullToInt(IDR["KategoriID"]), MConvert.NullToInt(IDR["UrunID"]), MConvert.NullToInt(IDR["FirmaID"]), MConvert.NullToFloat(IDR["Fiyat"]), MConvert.NullToFloat(IDR["KarOran"]), MConvert.NullToDateTime(IDR["EklenmeTarihi"]), MConvert.NullToDateTime(IDR["GuncellemeTarihi"]), FirmaMethods.GetFirma(MConvert.NullToInt(IDR["FirmaID"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvStok);
        }
コード例 #17
0
        ///<summary>
        /// Sehir Data Update
        ///</summary>
        public static int Update(Sehir p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update sehir set adi=?adi where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #18
0
        public static int GetFirmaCount(int pFirmaID)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select COUNT(FirmaID) from Stok where FirmaID=@FirmaID", conneciton))
                {
                    cmd.Parameters.Add("FirmaID", pFirmaID, MSqlDbType.Int);
                    rowsAffected = BAYMYO.UI.Converts.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #19
0
        ///<summary>
        /// CalismaAlani Data Select
        ///</summary>
        public static CalismaAlaniCollection GetSelect(System.Guid pHesapID)
        {
            CalismaAlaniCollection rvCalismaAlani = new CalismaAlaniCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM CalismaAlani WHERE HesapID=@HesapID", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvCalismaAlani.Add(new CalismaAlani(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["Kurum"]), MConvert.NullToString(IDR["Telefon"]), MConvert.NullToString(IDR["Adres"]), MConvert.NullToString(IDR["Semt"]), MConvert.NullToString(IDR["Sehir"]), MConvert.NullToString(IDR["WebSitesi"]), MConvert.NullToBool(IDR["Randevu"]), MConvert.NullToBool(IDR["Varsayilan"]), MConvert.NullToBool(IDR["Aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCalismaAlani);
        }
コード例 #20
0
        public static int Update(Stok p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "Update Stok SET KategoriID=@KategoriID,UrunID=@UrunID,FirmaID=@FirmaID,Fiyat=@Fiyat,KarOran=@KarOran,EklenmeTarihi=@EklenmeTarihi,GuncellemeTarihi=@GuncellemeTarihi where ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("KategoriID", p.KategoriID, MSqlDbType.Int);
                    cmd.Parameters.Add("UrunID", p.UrunID, MSqlDbType.Int);
                    cmd.Parameters.Add("FirmaID", p.FirmaID, MSqlDbType.Int);
                    cmd.Parameters.Add("Fiyat", p.Fiyat, MSqlDbType.Float);
                    cmd.Parameters.Add("KarOran", p.KarOran, MSqlDbType.Float);
                    cmd.Parameters.Add("EklenmeTarihi", p.EklenmeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("GuncellemeTarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #21
0
        public static AnketPuanCollection GetSelect(Int64 psoruid)
        {
            AnketPuanCollection rvAnketPuan = new AnketPuanCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from anketpuan where soruid=?soruid", conneciton))
                {
                    cmd.Parameters.Add("soruid", psoruid, MSqlDbType.BigInt);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvAnketPuan.Add(new AnketPuan(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToInt64(IDR["anketid"]), MConvert.NullToInt64(IDR["soruid"]), MConvert.NullToString(IDR["ip"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvAnketPuan);
        }
コード例 #22
0
        public static int Delete(Stok p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "delete from Stok where ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #23
0
        public static int Update(AnketPuan p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update anketpuan set hesapid=?hesapid,anketid=?anketid,soruid=?soruid,ip=?ip where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("anketid", p.AnketID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("soruid", p.SoruID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #24
0
        ///<summary>
        /// Begen Data PrimaryKey
        ///</summary>
        public static Begen GetBegen(System.Guid pID)
        {
            Begen rvBegen = new Begen();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM Begen WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvBegen = new Begen(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["IP"]), MConvert.NullToString(IDR["ModulID"]), MConvert.NullToString(IDR["IcerikID"]), MConvert.NullToBool(IDR["Durum"]), MConvert.NullToDateTime(IDR["KayitTarihi"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvBegen);
        }
コード例 #25
0
        public static int Remove(Int64 soruid)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "delete from anketpuan where soruid=?soruid", conneciton))
                {
                    cmd.Parameters.Add("soruid", soruid, MSqlDbType.BigInt);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #26
0
        ///<summary>
        /// Begen Data Update
        ///</summary>
        public static int Update(Begen p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Begen SET HesapID=@HesapID,IP=@IP,ModulID=@ModulID,IcerikID=@IcerikID,Durum=@Durum,KayitTarihi=@KayitTarihi WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Durum", p.Durum, MSqlDbType.Bit);
                    cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #27
0
        ///<summary>
        /// Video Data Update
        ///</summary>
        public static int Update(Video p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Video SET HesapID=@HesapID,KategoriID=@KategoriID,ResimUrl=@ResimUrl,Baslik=@Baslik,Embed=@Embed,Etiket=@Etiket,KayitTarihi=@KayitTarihi,Yorum=@Yorum,Aktif=@Aktif WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("KategoriID", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ResimUrl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Baslik", p.Baslik, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Embed", p.Embed, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Etiket", p.Etiket, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("Yorum", p.Yorum, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #28
0
        ///<summary>
        /// Sehir Data Select
        ///</summary>
        public static SehirCollection GetSelect()
        {
            SehirCollection rvSehir = new SehirCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from sehir order by adi asc", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvSehir.Add(new Sehir(MConvert.NullToByte(IDR["id"]), MConvert.NullToString(IDR["adi"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvSehir);
        }
コード例 #29
0
        public static Haber GetHaber(string pbaslik)
        {
            Haber rvHaber = new Haber();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from haber h where h.baslik=?baslik limit 1", conneciton))
                {
                    cmd.Parameters.Add("baslik", pbaslik, MSqlDbType.VarChar);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvHaber = new Haber(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["ozet"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToString(IDR["etiket"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToInt64(IDR["video"]), MConvert.NullToInt64(IDR["galeri"]), MConvert.NullToBool(IDR["uye"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["anasayfa"]), MConvert.NullToBool(IDR["aktif"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvHaber);
        }
コード例 #30
0
        ///<summary>
        /// Ýlan Data Count
        ///</summary>
        public static int Count(bool pyoneticionay)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select count(*) as totalcount from seriilan where yoneticionay=?yoneticionay", conneciton))
                {
                    cmd.Parameters.Add("yoneticionay", pyoneticionay, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }