private void bind()
    {
        int count = BlogManager.GetInstance().BlogBaseModel.BlogModel.RecentArticleListCount;
        listModel = ArticleManager.GetInstance().GetRecentArticleList( count );

        dlRecentArtcle.DataSource	= listModel;
        dlRecentArtcle.DataBind();
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string tag		= GetParamString( ArticleConst.PARAM_TAG );

        if( tag == null ) return;

        bindModel		= ArticleManager.GetInstance().GetArticleListByTag( tag, true );

        dlTagList.DataSource = bindModel;
        dlTagList.DataBind();
    }
    private void bind()
    {
        bindModel	= ArticleManager.GetInstance().GetArticleList( CurrentPage, PageSize, SearchMode, SearchKeyword, true );

        RecordCount			= bindModel.TotalCount;

        foreach (ArticleModel model in bindModel)
        {
            ArticleContent template = (ArticleContent)LoadControl(SnapManager.GetInstance().SnapCollection["Article"].ContentControl);
            template.ArticleNo = model.ArticleNo;
            phArticleList.Controls.Add(template);
        }
    }
示例#4
0
        /// <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);
            }
        }
示例#5
0
        /// <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);
            }
        }
示例#6
0
        /// <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);
            }
        }
示例#7
0
        /// <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);
            }
        }