コード例 #1
0
        ///<summary>
        /// ResmiIlan Data Insert
        ///</summary>
        public static Int64 Insert(ResmiIlan p)
        {
            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, "insert into resmiilan (baslik,icerik,sehir,kayittarihi,aktif) values(?baslik,?icerik,?sehir,?kayittarihi,?aktif); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("baslik", p.Baslik, MSqlDbType.VarChar);
                    cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.LongText);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #2
0
        public static int Count(byte pdurum, string pmail, bool paktif)
        {
            int rvCount = 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(id) as totalcount from mesaj where mail=?mail and durum=?durum and aktif=?aktif", conneciton))
                {
                    cmd.Parameters.Add("mail", pmail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("durum", pdurum, MSqlDbType.Byte);
                    cmd.Parameters.Add("aktif", paktif, MSqlDbType.Boolean);
                    rvCount = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #3
0
        ///<summary>
        /// Makale 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 makale 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);
        }
コード例 #4
0
        public static Int64 GetCount()
        {
            Int64 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(ID) from Teklif", conneciton))
                {
                    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 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);
        }
コード例 #6
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);
        }
コード例 #7
0
        public static Int64 GetCount(Guid pHesapID, byte pDurum, bool pYoneticiOnay)
        {
            Int64 rvCount = 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, "SELECT COUNT(ID) AS TotalCount FROM Randevu WHERE HesapID=@HesapID AND YoneticiOnay=@YoneticiOnay AND Durum=@Durum", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, BAYMYO.MultiSQLClient.MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("Durum", pDurum, MSqlDbType.TinyInt);
                    cmd.Parameters.Add("YoneticiOnay", pYoneticiOnay, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #8
0
        public static Int64 GetCount(bool pYoneticiOnay)
        {
            Int64 rvCount = 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, "SELECT COUNT(ID) AS TotalCount FROM Yorum WHERE YoneticiOnay=@YoneticiOnay", conneciton))
                {
                    cmd.Parameters.Add("YoneticiOnay", pYoneticiOnay, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #9
0
        ///<summary>
        /// Anket Data Insert
        ///</summary>
        public static Int64 Insert(Anket p)
        {
            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, "insert into anket (anketid,adi,kayittarihi,aktif,resimurl,grup,yatay) values(?anketid,?adi,?kayittarihi,?aktif,?resimurl,?grup,?yatay); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("anketid", p.AnketID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("grup", p.Grup, MSqlDbType.VarChar);
                    cmd.Parameters.Add("yatay", p.Yatay, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #10
0
        ///<summary>
        /// Mesaj Data Count
        ///</summary>
        public static int Count(byte pdurum, bool pyoneticionay)
        {
            int rvCount = 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(id) as totalcount from mesaj where durum=?durum and yoneticionay=?yoneticionay", conneciton))
                {
                    cmd.Parameters.Add("durum", pdurum, MSqlDbType.Byte);
                    cmd.Parameters.Add("yoneticionay", pyoneticionay, MSqlDbType.Boolean);
                    rvCount = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #11
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);
        }
コード例 #12
0
        public static int Count(string phesapid, string purl, bool pyoneticionay, bool paktif)
        {
            int rvCount = 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(y.id) AS totalcount from yorum y where (y.yoneticionay=?yoneticionay and y.aktif=?aktif) and (exists(select id from makale where makale.hesapid=?hesapid) or exists(select id from mesaj where mesaj.hesapid=?hesapid) or exists(select id from video where video.hesapid=?hesapid) or y.icerikid=?url)", conneciton))
                {
                    cmd.Parameters.Add("hesapid", phesapid, BAYMYO.MultiSQLClient.MSqlDbType.VarChar);
                    cmd.Parameters.Add("url", purl, BAYMYO.MultiSQLClient.MSqlDbType.VarChar);
                    cmd.Parameters.Add("yoneticionay", pyoneticionay, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", paktif, MSqlDbType.Boolean);
                    rvCount = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #13
0
        public static Int64 GetCount(string pMail, bool pAktif)
        {
            Int64 rvCount = 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, "SELECT COUNT(ID) AS TotalCount FROM Yorum WHERE Mail=@Mail AND Aktif=@Aktif", conneciton))
                {
                    cmd.Parameters.Add("Mail", pMail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Aktif", pAktif, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #14
0
        public static int Count(string picerikid)
        {
            int rvCount = 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(y.id) AS totalcount from yorum y where y.yoneticionay=1 and y.aktif=1 and y.icerikid=?icerikid", conneciton))
                {
                    cmd.Parameters.Add("icerikid", picerikid, BAYMYO.MultiSQLClient.MSqlDbType.VarChar);
                    rvCount = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #15
0
        ///<summary>
        /// Gosterim Data Count
        ///</summary>
        public static Int64 GetCount(string modulID, string id)
        {
            Int64 rvCount = 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, "SELECT COUNT(DISTINCT IP) AS TotalView FROM Gosterim WHERE ModulID=@ModulID AND IcerikID=@IcerikID", conneciton))
                {
                    cmd.Parameters.Add("ModulID", modulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("IcerikID", id, MSqlDbType.VarChar);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #16
0
        public static Int64 GetCount(Guid pHesapID, string pUrl, bool pYoneticiOnay, bool pAktif)
        {
            Int64 rvCount = 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, "SELECT COUNT(ID) AS TotalCount FROM Yorum WHERE (YoneticiOnay=@YoneticiOnay AND Aktif=@Aktif) AND (EXISTS(SELECT ID FROM Makale WHERE HesapID=@HesapID) OR EXISTS(SELECT ID FROM Mesaj WHERE HesapID=@HesapID) OR EXISTS(SELECT ID FROM Video WHERE HesapID=@HesapID) OR IcerikID=@Url)", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, BAYMYO.MultiSQLClient.MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("Url", pUrl, BAYMYO.MultiSQLClient.MSqlDbType.VarChar);
                    cmd.Parameters.Add("YoneticiOnay", pYoneticiOnay, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", pAktif, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #17
0
        ///<summary>
        /// Hesap Data Update
        ///</summary>
        public static string Update(Hesap 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, "select count(*) as totalcount from hesap where id<>?id and mail=?mail", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                    if (rowsAffected > 0)
                    {
                        switch (conneciton.State)
                        {
                        case System.Data.ConnectionState.Open:
                            conneciton.Close();
                            break;
                        }
                        conneciton.Dispose();
                        return("EMAIL");
                    }
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update hesap set ip=?ip,adi=?adi,soyadi=?soyadi,mail=?mail,sifre=?sifre,roller=?roller,onaykodu=?onaykodu,dogumtarihi=?dogumtarihi,kayittarihi=?kayittarihi,cinsiyet=?cinsiyet,tipi=?tipi,yorum=?yorum,abonelik=?abonelik,aktivasyon=?aktivasyon,aktif=?aktif where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("soyadi", p.Soyadi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sifre", p.Sifre, MSqlDbType.VarChar);
                    cmd.Parameters.Add("roller", p.Roller, MSqlDbType.VarChar);
                    cmd.Parameters.Add("onaykodu", p.OnayKodu, MSqlDbType.VarChar);
                    cmd.Parameters.Add("dogumtarihi", p.DogumTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("cinsiyet", p.Cinsiyet, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("tipi", p.Tipi, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("yorum", p.Yorum, MSqlDbType.Boolean);
                    cmd.Parameters.Add("abonelik", p.Abonelik, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktivasyon", p.Aktivasyon, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return((rowsAffected <= 0) ? string.Empty : p.ID);
        }
コード例 #18
0
        public static string Update(Kategori 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, "select count(*) as totalcount from kategori where id<>?id and modulid=?modulid and adi=?adi", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                    if (rowsAffected > 0)
                    {
                        switch (conneciton.State)
                        {
                        case System.Data.ConnectionState.Open:
                            conneciton.Close();
                            break;
                        }
                        conneciton.Dispose();
                        return("ADI");
                    }
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update kategori set id=?id,parentid=?parentid,modulid=?modulid,adi=?adi,dil=?dil,sira=?sira,menu=?menu,aktif=?aktif,renk=?renk,aciklama=?aciklama,etiket=?etiket where modulid=?modulid and id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("parentid", p.ParentID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("dil", p.Dil, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sira", p.Sira, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("menu", p.Menu, MSqlDbType.Byte);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    cmd.Parameters.Add("renk", p.Renk, MSqlDbType.VarChar);
                    cmd.Parameters.Add("aciklama", p.Aciklama, MSqlDbType.VarChar);
                    cmd.Parameters.Add("etiket", p.Etiket, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return((rowsAffected <= 0) ? string.Empty : p.ID);
        }
コード例 #19
0
        ///<summary>
        /// Profil Data Update
        ///</summary>
        public static string Update(Profil 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, "select count(*) as totalcount from profil where id<>?id and url=?url", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID);
                    cmd.Parameters.Add("url", p.Url);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                    if (rowsAffected > 0)
                    {
                        switch (conneciton.State)
                        {
                        case System.Data.ConnectionState.Open:
                            conneciton.Close();
                            break;
                        }
                        conneciton.Dispose();
                        return("URL");
                    }
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "update profil set url=?url,resimurl=?resimurl,adi=?adi,mail=?mail,web=?web,telefon=?telefon,gsm=?gsm,meslek=?meslek,egitim=?egitim,sehir=?sehir,hakkimda=?hakkimda where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("url", p.Url, MSqlDbType.VarChar);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("web", p.Web, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon", p.Telefon, MSqlDbType.VarChar);
                    cmd.Parameters.Add("gsm", p.GSM, MSqlDbType.VarChar);
                    cmd.Parameters.Add("meslek", p.Meslek, MSqlDbType.VarChar);
                    cmd.Parameters.Add("egitim", p.Egitim, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("hakkimda", p.Hakkimda, MSqlDbType.VarChar);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return((rowsAffected <= 0) ? string.Empty : p.ID);
        }
コード例 #20
0
        public static Int64 Insert(Teklif p)
        {
            Int64 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, "insert into Teklif (GemiAdi,BaglamaLimani,Acenta,Manager,Tarih,Kur1,Kur2,ParaBirimi,Kdv,TasimaUcreti,Iskonto,Hazirlayan,OdemeSekli,TeslimSuresi,Aciklama,GuncellemeTarihi,Durum,DurumNotu,TasimaUcretiNotu) values(@GemiAdi,@BaglamaLimani,@Acenta,@Manager,@Tarih,@Kur1,@Kur2,@ParaBirimi,@Kdv,@TasimaUcreti,@Iskonto,@Hazirlayan,@OdemeSekli,@TeslimSuresi,@Aciklama,@GuncellemeTarihi,@Durum,@DurumNotu,@TasimaUcretiNotu)", conneciton))
                {
                    cmd.Parameters.Add("GemiAdi", p.GemiAdi, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("BaglamaLimani", p.BaglamaLimani, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Acenta", p.Acenta, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Manager", p.Manager, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Tarih", p.Tarih, MSqlDbType.DateTime);
                    cmd.Parameters.Add("Kur1", p.Kur1, MSqlDbType.Float);
                    cmd.Parameters.Add("Kur2", p.Kur2, MSqlDbType.Float);
                    cmd.Parameters.Add("ParaBirimi", p.ParaBirimi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Kdv", p.Kdv, MSqlDbType.TinyInt);
                    cmd.Parameters.Add("TasimaUcreti", p.TasimaUcreti, MSqlDbType.Float);
                    cmd.Parameters.Add("Iskonto", p.Iskonto, MSqlDbType.Float);
                    cmd.Parameters.Add("Hazirlayan", p.Hazirlayan, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("OdemeSekli", p.OdemeSekli, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("TeslimSuresi", p.TeslimSuresi, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Aciklama", p.Aciklama, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("GuncellemeTarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("Durum", p.Durum, MSqlDbType.Number);
                    cmd.Parameters.Add("DurumNotu", p.DurumNotu, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("TasimaUcretiNotu", p.DurumNotu, MSqlDbType.NVarChar);
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        cmd.Parameters.Clear();
                        //;select top 1 ID from Teklif where GemiAdi=@GemiAdi and BaglamaLimani=@BaglamaLimani and Acenta=@Acenta and Manager=@Manager and Tarih=@Tarih;
                        cmd.CommandText = "SELECT @@IDENTITY";
                        rowsAffected    = MConvert.NullToInt64(cmd.ExecuteScalar());
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #21
0
        public static int Insert(Firma p)
        {
            using (Firma temp = FirmaMethods.GetFirma(p))
            {
                if (temp != null & temp.ID > 0)
                {
                    return(temp.ID);
                }
            }
            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, "insert into Firma (Kod,Adi,Yetkili,Telefon,Mail,Adres,Period) values(@Kod,@Adi,@Yetkili,@Telefon,@Mail,@Adres,@Period)", conneciton))
                {
                    cmd.Parameters.Add("Kod", p.Kod, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Yetkili", p.Yetkili, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Telefon", p.Telefon, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adres", p.Adres, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Period", p.Period, MSqlDbType.TinyInt);
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        cmd.Parameters.Clear();
                        cmd.CommandText = "SELECT @@IDENTITY";
                        rowsAffected    = MConvert.NullToInt(cmd.ExecuteScalar());
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #22
0
        public static int Insert(Urun p)
        {
            using (Urun temp = UrunMethods.GetUrun(p))
            {
                if (temp != null & temp.ID > 0)
                {
                    return(temp.ID);
                }
            }
            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, "insert into Urun (Kod,KategoriID,Adi,Miktar,Birim,Kdv,Tarih) values(@Kod,@KategoriID,@Adi,@Miktar,@Birim,@Kdv,@Tarih)", conneciton))
                {
                    cmd.Parameters.Add("Kod", p.Kod, MSqlDbType.VarChar);
                    cmd.Parameters.Add("KategoriID", p.KategoriID, MSqlDbType.Int);
                    cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Miktar", p.Miktar, MSqlDbType.Float);
                    cmd.Parameters.Add("Birim", p.Birim, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Kdv", p.Kdv, MSqlDbType.Float);
                    cmd.Parameters.Add("Tarih", p.Tarih, MSqlDbType.DateTime);
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        cmd.Parameters.Clear();
                        cmd.CommandText = "SELECT @@IDENTITY";
                        rowsAffected    = MConvert.NullToInt(cmd.ExecuteScalar());
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #23
0
        ///<summary>
        /// Haber Data Insert
        ///</summary>
        public static Int64 Insert(Haber p)
        {
            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, "insert into haber (hesapid,kategoriid,resimurl,baslik,ozet,icerik,etiket,sehir,kayittarihi,guncellemetarihi,gosterimsayi,video,galeri,uye,yorum,yoneticionay,anasayfa,aktif) values(?hesapid,?kategoriid,?resimurl,?baslik,?ozet,?icerik,?etiket,?sehir,?kayittarihi,?guncellemetarihi,?gosterimsayi,?video,?galeri,?uye,?yorum,?yoneticionay,?anasayfa,?aktif); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("baslik", p.Baslik, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ozet", p.Ozet, MSqlDbType.VarChar);
                    cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.LongText);
                    cmd.Parameters.Add("etiket", p.Etiket, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean);
                    cmd.Parameters.Add("video", p.Video, MSqlDbType.BigInt);
                    cmd.Parameters.Add("galeri", p.Galeri, MSqlDbType.BigInt);
                    cmd.Parameters.Add("uye", p.Uye, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yorum", p.Yorum, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean);
                    cmd.Parameters.Add("anasayfa", p.Anasayfa, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #24
0
        ///<summary>
        /// Firma Data Insert
        ///</summary>
        public static Int64 Insert(Firma p)
        {
            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, "insert into firma (hesapid,kategoriid,resimurl,adi,yetkili,adres,mail,web,telefon1,telefon2,gsm,sehir,kayittarihi,guncellemetarihi,gosterimsayi,yoneticionay,aktif) values(?hesapid,?kategoriid,?resimurl,?adi,?yetkili,?adres,?mail,?web,?telefon1,?telefon2,?gsm,?sehir,?kayittarihi,?guncellemetarihi,?gosterimsayi,?yoneticionay,?aktif); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("yetkili", p.Yetkili, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adres", p.Adres, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("web", p.Web, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon1", p.Telefon1, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon2", p.Telefon2, MSqlDbType.VarChar);
                    cmd.Parameters.Add("gsm", p.GSM, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #25
0
        ///<summary>
        /// Hesap Data Insert
        ///</summary>
        public static object Insert(Hesap p)
        {
            object rowsAffected = null;

            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, "Hesap_Insert", conneciton))
                {
                    cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adi", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(p.Adi.ToLower().Trim()), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Soyadi", p.Soyadi.ToUpper().Trim(), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Mail", p.Mail.Trim(), MSqlDbType.VarChar);
                    cmd.Parameters.Add("Sifre", p.Sifre, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Roller", p.Roller, MSqlDbType.VarChar);
                    cmd.Parameters.Add("OnayKodu", p.OnayKodu, MSqlDbType.VarChar);
                    cmd.Parameters.Add("DogumTarihi", p.DogumTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("Cinsiyet", MConvert.NullToByte(p.Cinsiyet), MSqlDbType.TinyInt);
                    cmd.Parameters.Add("Tipi", MConvert.NullToByte(p.Tipi), MSqlDbType.TinyInt);
                    cmd.Parameters.Add("Yorum", p.Yorum, MSqlDbType.Bit);
                    cmd.Parameters.Add("Abonelik", p.Abonelik, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktivasyon", p.Aktivasyon, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit);
                    rowsAffected = cmd.ExecuteScalar();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #26
0
        ///<summary>
        /// SeriIlan Data Insert
        ///</summary>
        public static Int64 Insert(SeriIlan p)
        {
            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, "insert into seriilan (hesapid,kategoriid,resimurl,baslik,detay,semt,sehir,telefon,fiyat,kimden,kayittarihi,guncellemetarihi,gosterimsayi,yoneticionay,aktif) values(?hesapid,?kategoriid,?resimurl,?baslik,?detay,?semt,?sehir,?telefon,?fiyat,?kimden,?kayittarihi,?guncellemetarihi,?gosterimsayi,?yoneticionay,?aktif); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("baslik", p.Baslik, MSqlDbType.VarChar);
                    cmd.Parameters.Add("detay", p.Detay, MSqlDbType.VarChar);
                    cmd.Parameters.Add("semt", p.Semt, MSqlDbType.VarChar);
                    cmd.Parameters.Add("sehir", p.Sehir, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon", p.Telefon, MSqlDbType.VarChar);
                    cmd.Parameters.Add("fiyat", p.Fiyat, MSqlDbType.Float);
                    cmd.Parameters.Add("kimden", p.Kimden, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #27
0
        public static int Insert(Kategori p)
        {
            using (Kategori temp = KategoriMethods.GetKategori(p))
            {
                if (temp != null & temp.ID > 0)
                {
                    return(temp.ID);
                }
            }
            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, "insert into Kategori (Kod,Adi) values(@Kod,@Adi)", conneciton))
                {
                    cmd.Parameters.Add("Kod", p.Kod, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adi", p.Adi.ToUpper(), MSqlDbType.NVarChar);
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        cmd.Parameters.Clear();
                        cmd.CommandText = "SELECT @@IDENTITY";
                        rowsAffected    = MConvert.NullToInt(cmd.ExecuteScalar());
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #28
0
        ///<summary>
        /// Gosterim Data Count
        ///</summary>
        public static int Count(string modulid, object id)
        {
            int rvCount = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                string query = string.Empty;
                switch (Settings.Site.CounterView)
                {
                case CounterViewType.Multiple:
                    query = "select count(ip) as totalview from gosterim where modulid=?modulid and icerikid=?icerikid";
                    break;

                default:
                    query = "select count(distinct ip) as totalview from gosterim where modulid=?modulid and icerikid=?icerikid";
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, query, conneciton))
                {
                    cmd.Parameters.Add("modulid", modulid, MSqlDbType.VarChar);
                    cmd.Parameters.Add("icerikid", id, MSqlDbType.VarChar);
                    rvCount = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                query = null;
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
コード例 #29
0
        ///<summary>
        /// Mesaj Data Insert
        ///</summary>
        public static Int64 Insert(Mesaj p)
        {
            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, "insert into mesaj (hesapid,ip,adi,mail,telefon,konu,icerik,yanit,kayittarihi,guncellemetarihi,durum,yoneticionay,aktif) values(?hesapid,?ip,?adi,?mail,?telefon,?konu,?icerik,?yanit,?kayittarihi,?guncellemetarihi,?durum,?yoneticionay,?aktif); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("telefon", p.Telefon, MSqlDbType.VarChar);
                    cmd.Parameters.Add("konu", p.Konu, MSqlDbType.VarChar);
                    cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.VarChar);
                    cmd.Parameters.Add("yanit", p.Yanit, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("durum", p.Durum, MSqlDbType.SmallInt);
                    cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
コード例 #30
0
        ///<summary>
        /// Album Data Insert
        ///</summary>
        public static Int64 Insert(Album p)
        {
            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, "insert into album (hesapid,kategoriid,adi,etiket,kayittarihi,guncellemetarihi,gosterimsayi,uye,yorum,yoneticionay,aktif) values(?hesapid,?kategoriid,?adi,?etiket,?kayittarihi,?guncellemetarihi,?gosterimsayi,?uye,?yorum,?yoneticionay,?aktif); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("etiket", p.Etiket, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean);
                    cmd.Parameters.Add("uye", p.Uye, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yorum", p.Yorum, MSqlDbType.Boolean);
                    cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }