<%@ page autoeventwireup="true" debug="true" enableeventvalidation="false" inherits="_N25_Basicl_Student_parents_moreadd, App_Web_59rphgcb" language="C#" validaterequest="false" %>

<!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>学生家长信息添加</title>
    <link href="../css/main1.css" rel="stylesheet" type="text/css" />

    <script src="../js/getstudent.js" type="text/javascript">
    </script>

    <script src="../js/json2.js" type="text/javascript"></script>

    <script src="../jquery-1.5.js" type="text/javascript">
    </script>

    <link href="../window/_css/window.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
 
    
    $(window.document).ready(function () {
    $("#Button").click(function () {


       var StuClaId=$.trim($("#banji").val());
      var stu = $.trim($("#stu").val());
          
          
        var par_acount = $.trim($("#par_acount").val());
        var par_password = $.trim($("#par_password").val());
        var par_name = $.trim($("#par_name").val());
        var par_sex = $.trim($("#par_sex").val());
        var par_tel = $.trim($("#par_tel").val());
        var par_address = $.trim($("#par_address").val());

        if (StuClaId=="") return Msg("抱歉!请选择班级!","banji");
         if (stu=="") return Msg("抱歉!请选择学生!","stu");
      

        if (par_acount == "") return Msg("抱歉!请输入家长帐号!", "par_acount");

      

        if (par_password == "") return Msg("抱歉!请输入密码!", "par_password");
        
        
        if (par_name == "") return Msg("抱歉!请输入家长姓名!", "par_name");
        
        if (par_sex == "") return Msg("抱歉!请选择性别!", "par_sex");
        
        
         if (par_tel == "") return Msg("抱歉!请输入联系电话!", "par_tel");
        
        var IsStuTel = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)$/;
        if (!IsStuTel.test(par_tel)) return Msg("抱歉!联系电话不正确!", "par_tel");

        if (par_address == "") return Msg("抱歉!请输入家庭住址!", "par_address");

       
    })
})
function Msg(s, obj) {
    $("#" + obj).css({
        "background-color": "#FFE1E1"
    });
    $("#" + obj).change(function () {
        if ($.trim($(this).val()) != "") {
            $("#" + obj).css({
                "background-color": ""
            });
        } else {
            $("#" + obj).css({
                "background-color": "#FFE1E1"
            });
        }
    });
    window.alert(s);
    return false
}
    
function TABLE1_onclick() {

}

    </script>

</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    
        <div class="title">
            学生家长信息
        </div>
        <div class="panel">
           班级： 
            <asp:DropDownList ID="banji"  AutoPostBack="true"   runat="server" OnSelectedIndexChanged="banji_SelectedIndexChanged">
            </asp:DropDownList>
            (默认密码123456)
        </div>
        <asp:DataList ID="DataList1" CssClass="gv"    runat="server" CellPadding="1" CellSpacing="3" RepeatColumns="4" OnItemDataBound="DataList1_ItemDataBound">
        <ItemTemplate>
            <table border="0" cellpadding="0" cellspacing="0" style="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid" >
                <tr>
                    <td align="center" rowspan="3" style="width: 70px" valign="middle">
                        <asp:Label ID="Label1" runat="server"  Font-Bold="true"  ForeColor="red" Text="1"></asp:Label><%# Eval("StuName")%><asp:HiddenField
                            ID="stuid" runat="server" Value='<%# Eval("StuId")%>' />
                    </td>
                    <td align="left"   style="height:26px" >
     家长帐号：<asp:TextBox ID="TextBox1" runat="server" Height="14" Text='<%#Eval("ParItemNo").ToString() == ""? Eval("StuItemNo") : Eval("ParItemNo")%>'
         Width="90px"></asp:TextBox> 
                        
                        </td>
                       
                </tr>
                <tr>
                   <td >
                   <hr   style="width:100%; height:1px;" />
                   </td>
                </tr>
                <tr>
                    <td align="left" style="height:26px"  >
                        家长姓名：<asp:TextBox ID="TextBox2" runat="server" Width="90px" Height="14" Text='<%# Eval("ParName").ToString()==""?"":Eval("ParName")%>'></asp:TextBox>
                    </td>
                </tr>
                
            </table>
            
            
        
        
        </ItemTemplate>
        </asp:DataList>
      
     <div class="panel">
         <asp:Button ID="Button1" runat="server" Text="提交" OnClick="Button1_Click1" />
         <asp:Button ID="Button2" runat="server" Text="返回列表" OnClick="Button2_Click1" />
     </div>
        
        
        
        

      
    </form>
</body>
</html>
