Esempio n. 1
0
        ///<summary>
        /// Makale Data Update
        ///</summary>
        public static int Update(Makale 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 makale set hesapid=?hesapid,kategoriid=?kategoriid,resimurl=?resimurl,baslik=?baslik,ozet=?ozet,icerik=?icerik,etiket=?etiket,kayittarihi=?kayittarihi,guncellemetarihi=?guncellemetarihi,gosterimsayi=?gosterimsayi,uye=?uye,yorum=?yorum,yoneticionay=?yoneticionay,aktif=?aktif where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.BigInt);
                    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("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 = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Esempio n. 2
0
        ///<summary>
        /// Makale Data Insert
        ///</summary>
        public static Int64 Insert(Makale 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 makale (hesapid,kategoriid,resimurl,baslik,ozet,icerik,etiket,kayittarihi,guncellemetarihi,gosterimsayi,uye,yorum,yoneticionay,aktif) values(?hesapid,?kategoriid,?resimurl,?baslik,?ozet,?icerik,?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("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("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);
        }
Esempio n. 3
0
        /// <summary>
        /// Makale Getir
        /// </summary>
        public static Makale GetMakale(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            Makale rvMakale = new Makale();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(cmdType, sqlQuery, conneciton))
                {
                    if (parameters != null)
                    {
                        foreach (MParameter item in parameters)
                        {
                            cmd.Parameters.Add(item);
                        }
                    }
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvMakale = new Makale(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.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToBool(IDR["uye"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvMakale);
        }
Esempio n. 4
0
 public void Remove(Makale obj)
 {
     this.List.Remove(obj);
 }
Esempio n. 5
0
 public int IndexOf(Makale obj)
 {
     return(this.List.IndexOf(obj));
 }
Esempio n. 6
0
 public bool Contains(Makale obj)
 {
     return(this.List.Contains(obj));
 }
Esempio n. 7
0
 public void Insert(int index, Makale obj)
 {
     this.List.Insert(index, obj);
 }
Esempio n. 8
0
 public int Add(Makale obj)
 {
     return(this.List.Add(obj));
 }