/// <summary> /// ���� ����Ʈ�� �����´�. /// </summary> /// <param name="articleNo"></param> /// <returns></returns> public static CommentBindModel GetCommentList(int articleNo) { SqlParameter[] param = { CreateInParam("@ArticleNo", SqlDbType.Int, 4, articleNo) }; SqlCommand cmd = GetSpCommand("UBC_GetCommentList", param); SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection); CommentBindModel bindModel; try { bindModel = new CommentBindModel(articleNo); while (reader.Read()) { CommentModel model = new CommentModel(); FillComment( reader, model ); bindModel.Add( model ); model = null; } return bindModel; } catch( Exception ex ) { throw ex; } finally { ReleaseCommand(cmd); } }
/// <summary> /// �ֽ� ��� ����Ʈ�� ������ŭ �����´�. /// </summary> /// <param name="count"></param> /// <returns></returns> public static CommentBindModel GetRecentCommentList(int count) { SqlParameter[] param = { CreateInParam("@Count", SqlDbType.Int,4, count ) }; SqlCommand cmd = GetSpCommand("UBC_GetRecentCommentList", param); SqlDataReader reader= cmd.ExecuteReader(CommandBehavior.CloseConnection); CommentBindModel bindModel = new CommentBindModel(); try { while(reader.Read()) { CommentModel model = new CommentModel(); FillComment( reader, model ); bindModel.Add( model ); model = null; } return bindModel; } catch( Exception ex) { throw new UmcDataException("UBC_GetRecentCommentList ���ν��� ȣ���� ����", ex); } finally { ReleaseCommand(cmd); } }