//-------------------------------------------------------------------------------------------------------------------
        private List <ArticleContentMediaItems> Init(string LogFilePath, string LogFileName, SqlCommand cmd)
        {
            SqlConnection con = db.getConnection();

            cmd.Connection = con;
            List <ArticleContentMediaItems> l_ArticleContentMediaItems = new List <ArticleContentMediaItems>();

            try
            {
                con.Open();
                SqlDataReader   reader      = cmd.ExecuteReader();
                SmartDataReader smartReader = new SmartDataReader(reader);
                while (smartReader.Read())
                {
                    ArticleContentMediaItems m_ArticleContentMediaItems = new ArticleContentMediaItems(db.ConnectionString);
                    m_ArticleContentMediaItems.ArticleContentMediaItemId = smartReader.GetInt32("ArticleContentMediaItemId");
                    m_ArticleContentMediaItems.ArticleContentId          = smartReader.GetInt32("ArticleContentId");
                    m_ArticleContentMediaItems.MediaItemId = smartReader.GetInt32("MediaItemId");
                    m_ArticleContentMediaItems.CrUserId    = smartReader.GetInt32("CrUserId");
                    m_ArticleContentMediaItems.CrDateTime  = smartReader.GetDateTime("CrDateTime");
                    l_ArticleContentMediaItems.Add(m_ArticleContentMediaItems);
                }
                smartReader.disposeReader(reader);
                db.closeConnection(con);
            }
            catch (SqlException ex)
            {
                LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
            }
            return(l_ArticleContentMediaItems);
        }
        //--------------------------------------------------------------------------------------------------------------------
        public ArticleContentMediaItems GetByMediaItemId(string LogFilePath, string LogFileName, int MediaItemId)
        {
            ArticleContentMediaItems RetVal = new ArticleContentMediaItems(db.ConnectionString);

            try
            {
                List <ArticleContentMediaItems> list = GetListByMediaItemId(LogFilePath, LogFileName, MediaItemId);
                if (list.Count > 0)
                {
                    RetVal = (ArticleContentMediaItems)list[0];
                }
            }
            catch (Exception ex)
            {
                LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
            }
            return(RetVal);
        }