/// <summary> /// ī�װ���� ��ƼŬ ����Ʈ�� �����´� /// </summary> /// <param name="node"></param> /// <returns></returns> public static ArticleBindModel GetArticleList(CategoryNodeValue node) { SqlParameter[] param = { CreateInParam("@CategoryID", SqlDbType.Int,4, node.CategoryID), CreateInParam("@CategoryStep", SqlDbType.Int,4, node.CategoryStep) }; SqlCommand cmd = GetSpCommand("UBA_GetArticleListByCategoryID", param); SqlDataReader reader = cmd.ExecuteReader( CommandBehavior.CloseConnection ); ArticleBindModel bindModel = new ArticleBindModel(); try { while (reader.Read()) { ArticleModel model = new ArticleModel(); FillArticle(reader, model); bindModel.Add(model); model = null; } return bindModel; } catch ( Exception ex ) { throw new UmcDataException("UBA_GetArticleListByCategoryID ���ν��� ȣ���� ����", ex); } finally { reader.Close(); ReleaseCommand(cmd); } }
/// <summary> /// �±� ��ƼŬ�� �����´�. /// </summary> /// <param name="currentPage"></param> /// <param name="pageCount"></param> /// <param name="tag"></param> /// <param name="publicArticle"></param> /// <returns></returns> public static ArticleBindModel GetArticleListByTag(string tag, bool publicArticle) { SqlParameter[] param = { CreateInParam("@Tag", SqlDbType.VarChar,50, tag), CreateInParam("@PublicArticle", SqlDbType.Bit,1, publicArticle) }; SqlCommand cmd = GetSpCommand("UBA_GetArticleListByTag", param); SqlDataReader reader = cmd.ExecuteReader( CommandBehavior.CloseConnection ); ArticleBindModel bindModel = new ArticleBindModel(); try { while (reader.Read()) { ArticleModel model = new ArticleModel(); FillArticle(reader, model); bindModel.Add(model); model = null; } return bindModel; } finally { ReleaseCommand(cmd); } }
/// <summary> /// �ֱ� ��ƼŬ�� �����´�. /// </summary> /// <param name="count"></param> /// <returns></returns> public static ArticleBindModel GetRecentArticleList(int count) { SqlParameter[] param = { CreateInParam("@Count", SqlDbType.Int,4, count) }; SqlCommand cmd = GetSpCommand("UBA_GetRecentArticle", param); SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection); ArticleBindModel bindModel = new ArticleBindModel(); try { while (reader.Read()) { ArticleModel model = new ArticleModel(); FillArticle(reader, model); bindModel.Add(model); model = null; } return bindModel; } catch (Exception ex) { throw new UmcDataException("UBA_GetRecentArticle ���ν��� ȣ���� ����", ex); } finally { ReleaseCommand(cmd); } }
/// <summary> /// �˻� �Ǵ� ������ ���� ��ƼŬ�� �����´�. /// </summary> /// <param name="currentPage"></param> /// <param name="pageCount"></param> /// <param name="searchMode"></param> /// <param name="searchKeyword"></param> /// <param name="publicArticle">��������Ʈ true / ����� ����Ʈ���� false</param> /// <returns></returns> public static ArticleBindModel GetArticleList(int currentPage, int pageCount, string searchMode, string searchKeyword, bool publicArticle) { SqlParameter[] param = { CreateInParam("@CurrentPage", SqlDbType.Int,4, currentPage), CreateInParam("@PageSize", SqlDbType.Int,4, pageCount), CreateInParam("@SearchMode", SqlDbType.VarChar,20, searchMode), CreateInParam("@SearchKeyword", SqlDbType.VarChar,20, searchKeyword), CreateInParam("@PublicArticle", SqlDbType.Bit,1, publicArticle) }; SqlCommand cmd = GetSpCommand("UBA_GetArticleList", param); SqlDataReader reader = cmd.ExecuteReader( CommandBehavior.CloseConnection ); ArticleBindModel bindModel = new ArticleBindModel(); try { if( reader.Read() ) bindModel.TotalCount= (int)reader["Count"]; if( !reader.NextResult() ) return bindModel; while (reader.Read()) { ArticleModel model = new ArticleModel(); FillArticle( reader, model ); bindModel.Add( model ); model = null; } return bindModel; } finally { ReleaseCommand(cmd); } }