<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WeiXinPage_List.aspx.cs"
    Inherits="RM.Web.WeiXin.WeiXinPage_List" %>

<%@ Register Src="~/UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("WeiXinPage_List_Title")%></title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <link href="../../Themes/Scripts/artDialog/skins/opera.css" rel="stylesheet" type="text/css" />
    <script src="../../Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
</head>
<body onload="M2M()">
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("WeiXinPage_List_wxymlb")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="text-align: right">
            <uc2:LoadButton ID="LoadButton1" runat="server" />
        </div>
    </div>
    <div class="div-body">
        <%=pageHtml.ToString() %>
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    //编辑
    function add() {
        //alert(Menu_Id);
        var url = "/WeiXin/WeiXinPage_Form.aspx";
        top.openDialog(url, 'WeiXinPage_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("WeiXinPage_List_Title")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Add")%>', 800, 500, 50, 50);
    }

    $(function () {
        //把分页定位到屏幕下面
        divresize(90);
        FixedTableHeader("#table1", $(window).height() - 121);
        $('.delData').click(function () {//删除数据
            var data = $(this).attr('data');
            DeleteData('/Ajax/Common_Ajax.ashx', 'action=Delete&tableName=TKS_WeiXinPage&pkName=WeiXinPage_Id&pkVal=' + data);
            return false;
        });
        $('.editData').click(function () {//编辑数据
            var key = $(this).attr('data');
            var url = "/WeiXin/WeiXinPage_Form.aspx?Key=" + key;
            top.openDialog(url, 'WeiXinPage_FormEdit', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("WeiXinPage_List_Title")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Edit")%>', 800, 500, 50, 50);
        });
        $('.createStaticFile').click(function () {//生成静态文件
            var key = $(this).attr('data');
            $.ajax({
                url: "/WeiXin/CreateStaticFiles.ashx",
                type: "post",
                data: { Key: key },
                dataType: "text",
                success: function (data) {
                    if (data < 1) {
                        switch (data) {
                            case -1:
                                showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("QuesNaire_WebFormatErr")%>', 4000, 5);
                                break;
                            case -2:
                                showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("QuesNaire_WebFormatErr")%>', 4000, 5);
                                break;
                            case -3:
                                showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("QuesNaire_WebFormatErr")%>', 4000, 5);
                                break;
                            case -4:
                                showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("QuesNaire_WebFormatErr")%>', 4000, 5);
                                break;
                            case -5:
                                showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("QuesNaire_WebFormatErr")%>', 3000, 5);
                                break;
                            default:
                                showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("QuesNaire_WebFormatErr")%>', 4000, 3);
                                break;
                        }
                        return false;
                    }
                    showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CG")%>', 2000, 4);
                    //刷新页面
                    window.location.reload();
                },
                error: function () {
                    showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("File_Exam")%>', 2000, 3);
                }
            });
            return false;
        });
    });
</script>
