예제 #1
0
        ///<summary>
        /// Gosterim Data Delete
        ///</summary>
        public static int Delete(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, "delete from gosterim 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>
        /// 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);
        }
예제 #3
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);
        }
예제 #4
0
        /// <summary>
        /// Gosterim Getir
        /// </summary>
        public static Gosterim GetGosterim(CommandType cmdType, string sqlQuery, MParameterCollection parameters)
        {
            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(cmdType, sqlQuery, conneciton))
                {
                    if (parameters != null)
                    {
                        foreach (MParameter item in parameters)
                        {
                            cmd.Parameters.Add(item);
                        }
                    }
                    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);
        }
예제 #5
0
 public void Remove(Gosterim obj)
 {
     this.List.Remove(obj);
 }
예제 #6
0
 public int IndexOf(Gosterim obj)
 {
     return(this.List.IndexOf(obj));
 }
예제 #7
0
 public bool Contains(Gosterim obj)
 {
     return(this.List.Contains(obj));
 }
예제 #8
0
 public void Insert(int index, Gosterim obj)
 {
     this.List.Insert(index, obj);
 }
예제 #9
0
 public int Add(Gosterim obj)
 {
     return(this.List.Add(obj));
 }