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

        Query.PageSize    = 0;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "HelpCateInfo.Help_Cate_ParentID", "=", "0"));
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "HelpCateInfo.Help_Cate_Site", "=", "CN"));
        Query.OrderInfos.Add(new OrderInfo("HelpCateInfo.Help_Cate_Sort", "ASC"));
        IList <HelpCateInfo> helpcate = MyHelpCate.GetHelpCates(Query, pub.CreateUserPrivilege("e2e6aec7-ff11-407b-9c3a-6317b06b1a7e"));

        if (helpcate != null)
        {
            int i = 0;
            foreach (HelpCateInfo entity in helpcate)
            {
                i++;
                if (i == 1 && cateid == 0)
                {
                    cateid = entity.Help_Cate_ID;
                }
                nav_string = nav_string + "<dl>";

                if (cateid == entity.Help_Cate_ID)
                {
                    nav_string += "<dt><p class=\"dropList3-hover\"><span>" + entity.Help_Cate_Name + "</span></p></dt><dd style=\"display:block;\">";
                }
                else
                {
                    nav_string += "<dt><p><span>" + entity.Help_Cate_Name + "</span></p></dt><dd>";
                }

                nav_string += Help_Left_Sub_Nav(entity.Help_Cate_ID, helpid, cateid);
                nav_string  = nav_string + "</dd></dl>";
            }
        }

        return(nav_string);
    }
Exemple #2
0
    public string GetHelpCates()
    {
        QueryInfo Query = new QueryInfo();

        Query.PageSize    = tools.CheckInt(Request["rows"]);
        Query.CurrentPage = tools.CheckInt(Request["page"]);
        string keyword = tools.CheckStr(Request["keyword"]);

        if (keyword.Length > 0)
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "str", "HelpCateInfo.Help_Cate_Name", "like", keyword));
        }
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "HelpCateInfo.Help_Cate_Site", "=", Public.GetCurrentSite()));
        Query.OrderInfos.Add(new OrderInfo(tools.CheckStr(Request["sidx"]), tools.CheckStr(Request["sord"])));

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

        IList <HelpCateInfo> entitys = MyBLL.GetHelpCates(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 (HelpCateInfo entity in entitys)
            {
                jsonBuilder.Append("{\"HelpCateInfo.Help_Cate_ID\":" + entity.Help_Cate_ID + ",\"cell\":[");
                //各字段
                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Help_Cate_ID);
                jsonBuilder.Append("\",");

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

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

                jsonBuilder.Append("\"");
                if (Public.CheckPrivilege("a0059a41-e628-4625-a67a-9da2f8b20fe1"))
                {
                    jsonBuilder.Append("<img src=\\\"/images/icon_edit.gif\\\" alt=\\\"修改\\\"> <a href=\\\"help_cate_edit.aspx?help_cate_id=" + entity.Help_Cate_ID + "\\\" title=\\\"修改\\\">修改</a>");
                }
                if (Public.CheckPrivilege("b14f283a-740b-48e1-b243-60105b87a9a6"))
                {
                    jsonBuilder.Append(" <img src=\\\"/images/icon_del.gif\\\"  alt=\\\"删除\\\"> <a href=\\\"javascript:void(0);\\\" onclick=\\\"confirmdelete('help_cate_do.aspx?action=move&help_cate_id=" + entity.Help_Cate_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);
        }
    }