/// <summary>
        /// Return collection
        /// </summary>
        public static ExtendedCollection<Comment> GetDataFields(IDataReader dr)
        {
            ExtendedCollection<Comment> list = new ExtendedCollection<Comment>();

            while (dr.Read())
            {
                Comment item = new Comment();

                if (dr["Author"] != DBNull.Value)
                {
                    item.Author = (string)dr["Author"];
                }
                if (dr["Email"] != DBNull.Value)
                {
                    item.Email = (string)dr["Email"];
                }
                if (dr["Date"] != DBNull.Value)
                {
                    item.Date = (DateTime)(dr["Date"]);
                }
                if (dr["Comments"] != DBNull.Value)
                {
                    item.Comments = (string)dr["Comments"];
                }
                if (dr["UID"] != DBNull.Value)
                {
                    item.UID = (int)dr["UID"];
                }

                list.Add(item);
            }

            dr.Close();

            return list;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Update Lyric Comment
        /// </summary>
        /// <returns></returns>
        public int UpdateLyricComments(Comment comment)
        {
            SqlParameter prmID = new SqlParameter("@ID", SqlDbType.Int, 4);
            prmID.Value = comment.ID;

            SqlParameter prmComment = new SqlParameter("@Comment", SqlDbType.VarChar, 350);
            prmComment.Value = comment.Comments;

            return DataAccess.Execute("UpdateLyricComments", prmID, prmComment);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Insert article comments
        /// </summary>
        /// <returns></returns>
        public int InsertArticleComment(Comment comment)
        {
            SqlParameter prmCommentID = new SqlParameter("@ID", SqlDbType.Int, 4);
            prmCommentID.Value = comment.ID;

            SqlParameter prmAuthor = new SqlParameter("@Author", SqlDbType.VarChar, 50);
            prmAuthor.Value = comment.Author;

            SqlParameter prmEmail = new SqlParameter("@Email", SqlDbType.VarChar, 50);
            prmEmail.Value = comment.Email;

            SqlParameter prmComment = new SqlParameter("@Comments", SqlDbType.VarChar, 350);
            prmComment.Value = comment.Comments;

            SqlParameter prmUserID = new SqlParameter("@UserID", SqlDbType.Int, 4);
            prmUserID.Value = comment.UID;

            return DataAccess.Execute("spInsertArticleComment", prmCommentID, prmAuthor, prmEmail, prmComment, prmUserID);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Delete individual article comment
        /// </summary>
        /// <returns></returns>
        public int DeleteArticleComment(Comment comment)
        {
            SqlParameter prmID = new SqlParameter("@ID", SqlDbType.Int, 4);
            prmID.Value = comment.ID;

            SqlParameter prmAID = new SqlParameter("@AID", SqlDbType.Int, 4);
            prmAID.Value = comment.RECID;

            return DataAccess.Execute("AdminDeleteArticleComments", prmID, prmAID);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Delete Lyric Comment
        /// </summary>
        /// <returns></returns>
        public int AdminDeleteLyricComments(Comment comment)
        {
            SqlParameter prmID = new SqlParameter("@COMID", SqlDbType.Int, 4);
            prmID.Value = comment.ID;

            SqlParameter prmLyricID = new SqlParameter("@RecipeID", SqlDbType.Int, 4);
            prmLyricID.Value = comment.RECID;

            return DataAccess.Execute("AdminDeleteLyricComments", prmID, prmLyricID);
        }
Exemplo n.º 6
0
 public virtual int Update(Comment comment)
 {
     return 0;
 }
Exemplo n.º 7
0
 public virtual int Delete(Comment comment)
 {
     return 0;
 }
Exemplo n.º 8
0
 public virtual int Add(Comment comment)
 {
     return 0;
 }
 /// <summary>
 /// Perform Update
 /// </summary>
 /// <returns></returns>
 public override int Update(Comment comment)
 {
     return Blogic.ActionProcedureDataProvider.UpdateLyricComments(comment);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Perform Delete
 /// </summary>
 /// <returns></returns>
 public override int Delete(Comment comment)
 {
     return Blogic.ActionProcedureDataProvider.AdminDeleteLyricComments(comment);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Perform Insert to Database
 /// </summary>
 /// <returns></returns>
 public override int Add(Comment comment)
 {
     return Blogic.ActionProcedureDataProvider.AddComment(comment);
 }
 /// <summary>
 /// Perform Update
 /// </summary>
 /// <returns></returns>
 public override int Update(Comment comment)
 {
     return Blogic.ActionProcedureDataProvider.UpdateArticleComment(comment);
 }
 /// <summary>
 /// Perform Insert to Database
 /// </summary>
 /// <returns></returns>
 public override int Add(Comment comment)
 {
     return Blogic.ActionProcedureDataProvider.InsertArticleComment(comment);
 }