<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="SMSEmailSet.aspx.cs" Inherits="OAWeb.SMSEmail.SMSEmailSet" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="../UserControls/SMSEmailNav.ascx" TagName="SMSEmailNav" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlace" runat="server">
    <script src="/js/jquery.form.js" type="text/javascript"></script>
    <style type="text/css">
        .tab_content
        {
            border: solid 1px #cccccc;
            border-top: none;
            padding: 10px;
        }
        .table_form .right
        {
            width: 60px;
        }
        
        .list .table_list th, .list .table_list td
        {
            text-align: left;
            line-height: 14px;
            height: 14px;
        }
    </style>
    <!--主体左侧-->
    <table id="plc_profile" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td class="main_left">
                <uc1:SMSEmailNav ID="SMSEmailNav1" runat="server" />
            </td>
            <td class="main_center">
                <!--主体-->
                <div class="page_main">
                    <div class="page_content">
                        <div class="tabs">
                            <div class="tab_handles">
                                <span type="1">短信设置</span> <span type="2">邮件设置</span>
                            </div>
                            <div class="tab_contents">
                                <div class="tab_content">
                                    <asp:Panel ID="pnlSms" runat="server">
                                        <table cellpadding="0" cellspacing="3" border="0" class="table_form">
                                            <tr>
                                                <td class="right">
                                                    账号:
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtUserName" runat="server" CssClass="text width200"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="right">
                                                    密码:
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtPassword" runat="server" CssClass="text width200"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr class="promote hide">
                                                <td class="right">
                                                    时间段:
                                                </td>
                                                <td>
                                                    设定
                                                    <asp:TextBox ID="txtSmsStartDate" runat="server" CssClass="text_box width40" Text="9"></asp:TextBox>点后开始发送
                                                    <span class="tip01">[只能是数据9-20，设置为不填写默认凌晨9点之后发送]</span>
                                                </td>
                                            </tr>
                                            <tr class="promote hide">
                                                <td class="right">
                                                    发送限制:
                                                </td>
                                                <td>
                                                    当天限制发送短信条数
                                                    <asp:TextBox ID="txtSmsSendNum" runat="server" CssClass="text_box width40" Text="1000"></asp:TextBox>条
                                                    <span class="tip01">[为0或不设置默认当天只能发送1000条]</span>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="right">
                                                </td>
                                                <td>
                                                    <asp:CheckBox ID="chkTimer" runat="server" Text="开启短信发送定时器" CssClass="promote hide" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="right">
                                                </td>
                                                <td>
                                                    <input id="btnSave" type="button" value=" 保 存 " class="btn_77px" />
                                                </td>
                                            </tr>
                                        </table>
                                        <script type="text/javascript">
                                            $(document).ready(function () {
                                                $("#btnSave").click(function () { return FormPostAjax("/SMSEmail/SMSEmailSet.aspx?op=Save&type=1&class=<%=SetClass %>", "ok", CloseReload); });
                                            })
                                        </script>
                                    </asp:Panel>
                                    <asp:Panel ID="pnlEmail" runat="server" Visible="false">
                                        <div class="page_op">
                                            <input id="btnAdd" type="button" value="添加" class="btn_77px" onclick="return OpenDialog('EmailSeverAdd.aspx?class=<%=SetClass %>','添加服务配置');" />
                                            <asp:Button ID="btnBatchEnabled" runat="server" Text="启用" CssClass="btn_77px" />
                                            <asp:Button ID="btnBatchUnEnabled" runat="server" Text="禁用" CssClass="btn_77px" />
                                            <asp:Button ID="btnBatchDelete" runat="server" Text="删除" CssClass="btn_77px" />
                                        </div>
                                        <div class="list">
                                            <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                                GridLines="None" CellPadding="0" CssClass="table_list" EnableModelValidation="True"
                                                OnRowDataBound="gvData_RowDataBound">
                                                <RowStyle HorizontalAlign="Left" />
                                                <Columns>
                                                    <asp:TemplateField HeaderText="编号">
                                                        <HeaderTemplate>
                                                            <input name="chkHeader" onclick="javascript:SelectAll(this);" type="checkbox" value="chkHeader" />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <input id="chkItem" type="checkbox" value="<%#Eval("Id") %>" />
                                                        </ItemTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" ForeColor="White"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Center" Width="10px"></ItemStyle>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="FromAddress" HeaderText="发件人邮箱" />
                                                    <asp:BoundField DataField="SmtpHost" HeaderText="SMTP服务器地址" />
                                                    <asp:BoundField DataField="SmtpPort" HeaderText="SMTP服务器端口" />
                                                    <asp:BoundField DataField="UserName" HeaderText="SMTP用户名" />
                                                    <asp:BoundField DataField="Password" HeaderText="SMTP密码" />
                                                    <asp:BoundField DataField="EnableSsl" HeaderText="启用SSL" />
                                                    <asp:TemplateField HeaderText="启用状态">
                                                        <ItemTemplate>
                                                            <img class='<%#Eval("Enabled").ToString().Equals("1") ? "ico01" : "ico02"%>' src="/images/transparent.gif" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="SendNum" HeaderText="数量限制" />
                                                    <asp:BoundField DataField="FailCount" HeaderText="已发失败数" />
                                                    <asp:TemplateField HeaderText="操作">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lbtnEdit" runat="server" Text='编辑'></asp:LinkButton>
                                                            <asp:LinkButton ID="lbtnDelete" runat="server">删除</asp:LinkButton>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="80px" />
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                            <div class="pager-bar">
                                                <webdiyer:AspNetPager ID="pager" runat="server" CssClass="anpager" currentpagebuttonclass="cpb"
                                                    PageSize="20" NextPageText="下一页" LastPageText="页 尾" FirstPageText="第一页" PrevPageText="上一页"
                                                    ShowBoxThreshold="10" SubmitButtonText="跳 转" UrlPaging="True">
                                                </webdiyer:AspNetPager>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        $(document).ready(function () {
            var tabs = $(".tab_handles span");
            $.each(tabs, function () {
                if ($(this).attr("type") == "<%=SetType %>")
                    $(this).addClass("current");
            })
            $(".tab_handles span").click(function () {
                window.location.href = "SMSEmailSet.aspx?type=" + $(this).attr("type") + "&class=<%=SetClass %>";
            })
            if ('<%=SetClass %>' == "promote") {
                $(".promote").show();
            }
        })
    </script>
</asp:Content>
