コード例 #1
0
    /// <summary>
    /// 关于我们左侧列表
    /// </summary>
    /// <param name="type"></param>
    /// <param name="sign"></param>
    /// <returns></returns>
    public string Help_About_Nav(string sign)
    {
        StringBuilder strHTML = new StringBuilder();

        QueryInfo Query = new QueryInfo();

        Query.PageSize    = 0;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "AboutInfo.About_IsActive", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "AboutInfo.About_Site", "=", "CN"));
        Query.OrderInfos.Add(new OrderInfo("AboutInfo.About_Sort", "ASC"));
        IList <AboutInfo> abouts = MyAbout.GetAbouts(Query, pub.CreateUserPrivilege("db8de73b-9ac0-476e-866e-892dd35589c5"));

        Query = null;
        if (abouts != null)
        {
            foreach (AboutInfo entity in abouts)
            {
                if (sign == entity.About_Sign)
                {
                    strHTML.Append("<li class=\"on\"><a href=\"/about/index.aspx?sign=" + entity.About_Sign + "\">" + entity.About_Title + "</a></li>");
                }
                else
                {
                    strHTML.Append("<li><a href=\"/about/index.aspx?sign=" + entity.About_Sign + "\">" + entity.About_Title + "</a></li>");
                }
            }
        }

        return(strHTML.ToString());
    }
コード例 #2
0
ファイル: About.cs プロジェクト: Abnertd/public
    public string GetAbouts()
    {
        QueryInfo Query = new QueryInfo();

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

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

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

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

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

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

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

                jsonBuilder.Append("\"");

                if (Public.CheckPrivilege("b15dd1c4-d9c5-4b09-b7c2-3ef4d24af7ef"))
                {
                    jsonBuilder.Append("<img src=\\\"/images/icon_edit.gif\\\" alt=\\\"修改\\\"> <a href=\\\"about_edit.aspx?about_id=" + entity.About_ID + "\\\" title=\\\"修改\\\">修改</a>");
                }

                if (Public.CheckPrivilege("622c8cf4-0cae-47f7-bd02-19bd8b5c169d"))
                {
                    jsonBuilder.Append(" <img src=\\\"/images/icon_del.gif\\\"  alt=\\\"删除\\\"> <a href=\\\"javascript:void(0);\\\" onclick=\\\"confirmdelete('about_do.aspx?action=move&about_id=" + entity.About_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);
        }
    }