Exemplo n.º 1
0
        public IActionResult Search()
        {
            int         UserID  = DataConvert.CLng(RequestEx["UserID"]);
            string      result  = "";
            PageSetting setting = bkBll.SelByInfo(CPage, 20, Tittle, BType, UserID);

            if (Request.IsAjax())
            {
                return(PartialView("Search_List", setting));
            }
            if (string.IsNullOrEmpty(Tittle + BType) && UserID == 0)
            {
                result = "<div class='alert alert-warning'>未输入查询条件</div>";
            }
            if (setting.itemCount < 1)
            {
                if (!string.IsNullOrEmpty(Tittle))
                {
                    result = "<div class='alert alert-info'>" + Call.SiteName + "百科尚未收录该词条\"<font color='red'>" + Tittle + "</font>\",也未找到相关词条。<br/>欢迎您来创建,与广大网友分享关于该词条的信息。<a href='BKEditor?tittle=" + Tittle + "'><font color='blue'>我来创建</font></a></div>";
                }
                else
                {
                    result = "<div class='alert alert-info'>" + Call.SiteName + "百科尚未收录该词条<br/>欢迎您来创建,与广大网友分享各种词条的信息</div>";
                }
            }
            ViewBag.result = result;
            ViewBag.BType  = BType;
            return(View(setting));
        }
Exemplo n.º 2
0
    private void MyBind()
    {
        DataTable dt = bkBll.SelByInfo(Tittle, BType);

        if (!string.IsNullOrEmpty(Tittle))
        {
            if (dt.Rows.Count < 1)
            {
                lblTittle.Text = "<div>逐浪百科尚未收录词条\"<font color='red'>" + Tittle + "</font>\",也未找到相关词条。<br/>欢迎您来创建,与广大网友分享关于该词条的信息。<a href='BKEditor.aspx?tittle=" + Tittle + "'><font color='blue'>我来创建</font></a></div>";
            }
        }
        else if (!string.IsNullOrEmpty(BType))
        {
            if (dt.Rows.Count < 1)
            {
                lblTittle.Text = "<div>逐浪百科尚未收录词条<br/>欢迎您来创建,与广大网友分享各种词条的信息。</div>";
            }
        }
        else
        {
            function.WriteErrMsg("未输入查询条件");
        }
        repSearch.DataSource = dt;
        repSearch.DataBind();
    }