Пример #1
0
        ///<summary>
        /// Galeri Data Delete
        ///</summary>
        public static int Delete(Galeri 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 galeri 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);
        }
Пример #2
0
        ///<summary>
        /// Galeri Data Update
        ///</summary>
        public static int Update(Galeri 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 galeri set albumid=?albumid,resimurl=?resimurl,aciklama=?aciklama,kayittarihi=?kayittarihi,kapak=?kapak where id=?id", conneciton))
                {
                    cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("albumid", p.AlbumID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("aciklama", p.Aciklama, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("kapak", p.Kapak, MSqlDbType.Boolean);
                    rowsAffected = cmd.ExecuteNonQuery();
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #3
0
        ///<summary>
        /// Galeri Data PrimaryKey
        ///</summary>
        public static Galeri GetGaleri(System.String pid)
        {
            Galeri rvGaleri = new Galeri();

            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 galeri where id=?id limit 1", conneciton))
                {
                    cmd.Parameters.Add("id", pid, MSqlDbType.VarChar);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvGaleri = new Galeri(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToInt64(IDR["albumid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["aciklama"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["kapak"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvGaleri);
        }
Пример #4
0
        /// <summary>
        /// Galeri Getir
        /// </summary>
        public static Galeri GetGaleri(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            Galeri rvGaleri = new Galeri();

            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())
                        {
                            rvGaleri = new Galeri(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToInt64(IDR["albumid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["aciklama"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["kapak"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvGaleri);
        }
Пример #5
0
 public void Remove(Galeri obj)
 {
     this.List.Remove(obj);
 }
Пример #6
0
 public int IndexOf(Galeri obj)
 {
     return(this.List.IndexOf(obj));
 }
Пример #7
0
 public bool Contains(Galeri obj)
 {
     return(this.List.Contains(obj));
 }
Пример #8
0
 public void Insert(int index, Galeri obj)
 {
     this.List.Insert(index, obj);
 }
Пример #9
0
 public int Add(Galeri obj)
 {
     return(this.List.Add(obj));
 }