Beispiel #1
0
    protected void KeySearchBtn_Click(object sender, EventArgs e)
    {
        DAL.DArticle DAr = new DAL.DArticle();
        string       key = KeyText.Value;

        singleBlogDiv.Attributes["style"]  = "display:none;";
        MainContentDiv.Attributes["style"] = "display:block;";
        if (key.Equals(" 请输入关键字.....") || key.Equals("") || key.Contains("全部"))
        {
            KeyText.Value = "全部";
            PageList      = new Paging(DAr.GetAll().ToList <Object>(), 6);
            RefreshList();
        }
        else if (key.Contains("精品"))
        {
            PageList = new Paging(DAr.GetArticleByTitleAndTypeAndIsImportant("", "", 1).ToList <Object>(), 6);
            RefreshList();
        }
        else if (key.Contains("热门"))
        {
            PageList = new Paging(DAr.GetByTotalReadTop8().ToList <Object>(), 6);
            RefreshList();
        }
        else
        {
            PageList = new Paging(DAr.GetArticleByTitleOrTypeOrName(key, key, key).ToList <Object>(), 6);
            RefreshList();
        }
    }
Beispiel #2
0
    protected void UserSearchBox_Click(object sender, EventArgs e)
    {
        DAL.DArticle DAr = new DAL.DArticle();
        string       key = UserNameText.Value;

        if (key.Equals(" 请输入作者名") || key.Equals("") || key.Contains("全部"))
        {
            UserNameText.Value        = "全部";
            HotArticleList.DataSource = DAr.GetAll();
            HotArticleList.DataBind();
        }
        else
        {
            HotArticleList.DataSource = DAr.GetArticleByTitleOrTypeOrName("", "", key);
            HotArticleList.DataBind();
        }
    }
Beispiel #3
0
 private void DealRightContent(int id, string qq)
 {
     DAL.DArticle DAr = new DAL.DArticle();
     if (id != 0)
     {
         info = DAr.GetArticleById(id);
         singleBlogDiv.Attributes["style"]  = "display:block;min-height:800px;";
         MainContentDiv.Attributes["style"] = "display:none;";
         DAr.AddReadedMount(id);
     }
     else
     {
         singleBlogDiv.Attributes["style"]  = "display:none;";
         MainContentDiv.Attributes["style"] = "display:block;";
         PageList = new Paging(DAr.GetByQQ(qq).ToList <Object>(), 6);
         RefreshList();
     }
 }