Beispiel #1
0
    /// <summary>
    /// 帮助中心左侧列表
    /// </summary>
    /// <param name="Cate_ID"></param>
    /// <param name="helpid"></param>
    /// <param name="cateid"></param>
    /// <returns></returns>
    public string Help_Left_Sub_Nav(int Cate_ID, int helpid, int cateid)
    {
        string    nav_string = "";
        QueryInfo Query      = new QueryInfo();

        Query.PageSize    = 0;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "HelpInfo.Help_CateID", "=", Cate_ID.ToString()));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "HelpInfo.Help_IsActive", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "HelpInfo.Help_Site", "=", "CN"));
        Query.OrderInfos.Add(new OrderInfo("HelpInfo.Help_ID", "asc"));
        IList <HelpInfo> helps = MyHelp.GetHelps(Query, pub.CreateUserPrivilege("a015e960-173c-429d-98d2-69e5a023b5dc"));

        if (helps != null)
        {
            nav_string += "  <ul class=\"lst20\">";

            foreach (HelpInfo entity in helps)
            {
                if (helpid == entity.Help_ID)
                {
                    nav_string += "<li class=\"on\"><a href=\"/help/index.aspx?help_id=" + entity.Help_ID + "\">" + entity.Help_Title + "</a></li>";
                }
                else
                {
                    nav_string += "<li><a href=\"/help/index.aspx?help_id=" + entity.Help_ID + "\">" + entity.Help_Title + "</a></li>";
                }
            }
            nav_string += "  </ul>";
        }
        return(nav_string);
    }
Beispiel #2
0
    public string GetHelps()
    {
        string    keyword = tools.CheckStr(Request["keyword"]);
        int       CateID  = tools.CheckInt(Request["CateID"]);
        QueryInfo Query   = new QueryInfo();

        Query.PageSize    = tools.CheckInt(Request["rows"]);
        Query.CurrentPage = tools.CheckInt(Request["page"]);
        if (CateID > 0)
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "str", "HelpInfo.Help_CateID", "=", CateID.ToString()));
        }
        if (keyword.Length > 0)
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "str", "HelpInfo.Help_Title", "like", keyword));
        }
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "HelpInfo.Help_Site", "=", Public.GetCurrentSite()));
        Query.OrderInfos.Add(new OrderInfo(tools.CheckStr(Request["sidx"]), tools.CheckStr(Request["sord"])));

        PageInfo pageinfo = MyBLL.GetPageInfo(Query, Public.GetUserPrivilege());

        HelpCateInfo CateInfo;

        IList <HelpInfo> entitys = MyBLL.GetHelps(Query, Public.GetUserPrivilege());

        if (entitys != null)
        {
            StringBuilder jsonBuilder = new StringBuilder();
            jsonBuilder.Append("{\"page\":" + pageinfo.CurrentPage + ",\"total\":" + pageinfo.PageCount + ",\"records\":" + pageinfo.RecordCount + ",\"rows\"");
            jsonBuilder.Append(":[");
            foreach (HelpInfo entity in entitys)
            {
                CateInfo = cate.GetHelpCateByID(entity.Help_CateID);

                jsonBuilder.Append("{\"HelpInfo.Help_ID\":" + entity.Help_ID + ",\"cell\":[");
                //各字段
                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Help_ID);
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append(Public.JsonStr(entity.Help_Title));
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                if (CateInfo != null)
                {
                    jsonBuilder.Append(CateInfo.Help_Cate_Name);
                }
                else
                {
                    jsonBuilder.Append(entity.Help_CateID);
                }
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Help_Sort);
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                if (Public.CheckPrivilege("14422eb0-8367-45e1-b955-c40aee162094"))
                {
                    jsonBuilder.Append("<img src=\\\"/images/icon_edit.gif\\\" alt=\\\"修改\\\"> <a href=\\\"help_edit.aspx?help_id=" + entity.Help_ID + "\\\" title=\\\"修改\\\">修改</a>");
                }
                if (Public.CheckPrivilege("c8585704-c4d5-40e8-8f5c-89940b5d7dfc"))
                {
                    jsonBuilder.Append(" <img src=\\\"/images/icon_del.gif\\\"  alt=\\\"删除\\\"> <a href=\\\"javascript:void(0);\\\" onclick=\\\"confirmdelete('help_do.aspx?action=move&help_id=" + entity.Help_ID + "')\\\" title=\\\"删除\\\">删除</a>");
                }
                jsonBuilder.Append("\",");

                jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                jsonBuilder.Append("]},");
            }
            jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
            jsonBuilder.Append("]");
            jsonBuilder.Append("}");
            return(jsonBuilder.ToString());
        }
        else
        {
            return(null);
        }
    }