<%@ Page Title="邮件服务" Language="C#" MasterPageFile="~/Manager/Manger.Master" EnableEventValidation="false" AutoEventWireup="true" validateRequest="false" CodeBehind="MStmp.aspx.cs" Inherits="Stat.web.Manerger.MStmp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
    
    $(document).ready(function(){
 
 $("input[name$='btnEditSave']").bind('click',CheckFrom); 
 $("a:contains('删除')").bind('click',function(){return confirm('确认要删除吗？');}); 
 
});

 function CheckFrom()
 {
     var txtStmp=$("input[name$='txtStmp']").val();  
     var txtEName=$("input[name$='txtEName']").val();  
    if(!CheckLength(txtStmp, 1)){alert("发信服务器不能为空！");$("input[name$='txtStmp']").focus();return false;} 
    if(!CheckLength(txtEName, 1)){alert("用户不能为空！");$("input[name$='txtEName']").focus();return false;}  
 }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpTop" runat="server">
<div style="margin-top: 5px;">
   当前位置：系统配置 &gt; 邮件服务
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpMSG" runat="server">
 <span class="M_b14">小贴士：</span> 你可以更改邮件发送服务信息。
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cpMain" runat="server">
<br />
      <table align="left" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td style="height: 490px;" valign="top" align="center">
                    <asp:Panel ID="pnWebList" runat="server" BackColor="White" Height="50px" Width="100%">
                        <asp:GridView ID="gvWebList" runat="server" AutoGenerateColumns="False" EmptyDataText="没有找到，请添加"
                            GridLines="None" Width="100%" BorderColor="#CEDFEF" BorderWidth="1px" 
                            onrowdatabound="gvWebList_RowDataBound" onrowdeleting="gvWebList_RowDeleting" 
                            onrowediting="gvWebList_RowEditing" CssClass="tableBorder">
                            <Columns>
                                <asp:BoundField DataField="id" HeaderText="ID" SortExpression="WebId">
                                    <HeaderStyle Height="25px" />
                                    <ItemStyle Width="50px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="MailSmtp" HeaderText="邮件服务器地址" SortExpression="WebUrl" >
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="状态" >
                                    <ItemTemplate >
                                        <asp:Label ID="Label1" runat="server" Text='<%# IsState(Eval("State")) %>'></asp:Label>                                      
                                    </ItemTemplate>
                                    <ItemStyle Width="70px" CssClass="forumRow" />
                                </asp:TemplateField>
                                <asp:ButtonField CommandName="Edit" Text="编辑">
                                    <ItemStyle Width="40px" />
                                </asp:ButtonField>
                                <asp:CommandField ShowDeleteButton="True">
                                    <ItemStyle Width="40px" />
                                </asp:CommandField>
                            </Columns>                            
                            <HeaderStyle BackColor="#E9F1FA" Height="20px" />
                        </asp:GridView>
                       </asp:Panel>
                    <asp:Panel ID="pnEditWeb" runat="server" BackColor="White" Visible="False"
                        Width="100%">
                        <table bgcolor="#cedfef" border="0" cellpadding="0" cellspacing="1" class="padding" width="100%">
                            <tr>
                                <td  colspan="2" style="height: 26px" bgcolor="#e9f1fa" height="25">
                                    <strong><span style="font-size: 12pt">
                                    添加/修改系统EMAIL配置</span></strong></td>
                            </tr>
                            <tr>
                                <td style="width: 165px; height: 25px; text-align: right" bgcolor="#FFFFFF">
                                   Smtp服务器地址：</td>
                                <td style="width: 512px; height: 25px; text-align: left" bgcolor="#FFFFFF">
                                    <asp:TextBox ID="txtStmp" runat="server" Width="250px"></asp:TextBox>(不支持 QQ邮箱)
                                    </td>
                            </tr>
                            <tr style="color: #000000">
                                <td style="width: 165px; height: 26px; text-align: right" bgcolor="#FFFFFF">
                                    EMAIL登陆名：</td>
                                <td style="width: 512px; height: 26px; text-align: left" bgcolor="#FFFFFF">
                                    <asp:TextBox ID="txtEName" runat="server" Width="250px"></asp:TextBox>
                                    </td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#FFFFFF" style="width: 165px; height: 26px; text-align: right">
                                  EMAIL密码：</td>
                                <td bgcolor="#FFFFFF" style="width: 512px; height: 26px; text-align: left">                               


                             <asp:TextBox ID="txtEPass" runat="server" Width="250px"></asp:TextBox>


       
       
                                </td>
                            </tr>
                            <tr>
                                <td bgcolor="#FFFFFF" style="width: 165px; height: 26px; text-align: right">
                                    发信内容：</td>
                                <td bgcolor="#FFFFFF" style="width: 512px; height: 26px; text-align: left">
                                    <asp:TextBox ID="txtInfo" runat="server" Height="134px" TextMode="MultiLine" 
                                        Width="250px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td bgcolor="#FFFFFF" colspan="2" style="height: 26px; text-align:left">
                                    注：发信内容可以是 html代码。目前可用动态标签为： {用户名}  {新密码} {当前时间}</td>
                            </tr>
                            <tr style="color: #000000">
                                <td bgcolor="#ffffff" style="width: 165px; height: 26px; text-align: right">
                                    是否启用：</td>
                                <td bgcolor="#ffffff" style="width: 512px; height: 26px; text-align: left">
                                    <asp:RadioButtonList ID="rBtnState" runat="server" RepeatDirection="Horizontal">
                                        <asp:ListItem Selected="True" Value="1">启用</asp:ListItem>
                                        <asp:ListItem Value="0">禁止</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td bgcolor="#FFFFFF" colspan="2" style="height: 26px">
                                    &nbsp;<asp:Button ID="btnEditSave" runat="server" OnClick="btnEditSave_Click" 
                                        Text="保存数据" />
                                    <asp:HiddenField ID="hdfStmpId" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>

        </table> 
</asp:Content>
