예제 #1
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);
            }
        }
예제 #2
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);
            }
        }
예제 #3
0
    private void bind()
    {
        model = BlogManager.GetInstance().BlogBaseModel;

        rblCanWriteMemo.SelectedValue          = model.PrivacyModel.CanWriteMemo.ToString();
        rblCanWriteGuestBoard.SelectedValue    = model.PrivacyModel.CanWriteGuestBoard.ToString();
        rblCanWriteBbs.SelectedValue           = model.PrivacyModel.CanWriteBbs.ToString();
        rblPublicRSS.SelectedValue             = model.PrivacyModel.PublicRSS.ToString();
        rblAllowMouseRightButton.SelectedValue = model.PrivacyModel.AllowMouseRightButton.ToString();
        rblLimitRssCount.SelectedValue         = model.PrivacyModel.LimitRssCount.ToString();

        if (IsPostBack)
        {
            return;
        }

        ArticleBindModel articleBindModel = ArticleManager.GetInstance().GetRecentArticleList(int.MaxValue);

        foreach (ArticleModel articleModel in articleBindModel)
        {
            ddlGuestBookArticle.Items.Add(new ListItem(articleModel.Title, articleModel.ArticleNo.ToString()));
        }

        ddlGuestBookArticle.SelectedValue = model.PrivacyModel.GuestBoardArticleNo.ToString();
    }
    private void bind()
    {
        int count = BlogManager.GetInstance().BlogBaseModel.BlogModel.RecentArticleListCount;

        listModel = ArticleManager.GetInstance().GetRecentArticleList(count);

        dlRecentArtcle.DataSource = listModel;
        dlRecentArtcle.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);
        }
    }
예제 #6
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();
    }
예제 #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);
            }
        }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string           nodeValue = GetParamString("nodeValue");
        string           date      = GetParamString("date");
        ArticleBindModel bindModel = null;

        if (nodeValue != null)
        {
            CategoryNodeValue CurrentCategoryNodeValue = CategoryNodeValue.Parse(nodeValue);
            bindModel = ArticleManager.GetInstance().GetArticleList(CurrentCategoryNodeValue);
        }
        else if (date != null)
        {
            bindModel = ArticleManager.GetInstance().GetArticleList(date);
        }

        dlCategory.DataSource = (ArticleBindModel)bindModel;
        dlCategory.DataBind();
    }
예제 #9
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);
            }
        }