<%@ page language="C#" autoeventwireup="true" inherits="ShopOutStockLogAdd, WebApp_deploy" %>

<!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 runat="server">
    <title>缺货登记</title>
</head>
<link href="../Skin/Default/Member/Red.css" rel="stylesheet" type="text/css" />
<link href="../Skin/TopStyle/Basic.css" rel="stylesheet" type="text/css" />
<script src="../Skin/CommStyle/js/jquery-1.8.3.min.js" type="text/javascript"></script>
<body>
    <form id="form1" runat="server">
    <div>
        <hl:Top ID="top1" runat="server" />
        <div class="TabText" style="width: 600px; text-align: center; margin-left: 20%;">
            <br />
            <table class="ShopOrderStyle">
                <caption style="text-align: left">
                    &nbsp;缺货登记</caption>
                <tr>
                    <td colspan="2">
                        &nbsp;非常抱歉，商品:<span style="color: Red"><asp:Literal ID="ltrProductname" runat="server"></asp:Literal></span>
                        <br />
                        &nbsp;暂时缺货。请您留下详细联系方式，商品到货后我们将第一时间通知您！
                    </td>
                </tr>
                <tr>
                    <td class="OrderTitle" align="right">
                        &nbsp;Email地址 ：
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="OrderTitle" align="right">
                        &nbsp;手机号码 ：
                    </td>
                    <td>
                        <asp:TextBox ID="txtMobilePhone" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="OrderTitle" align="right">
                        &nbsp;订购数量 ：
                    </td>
                    <td>
                        <asp:TextBox ID="txtBookCount" runat="server" Text="1"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td colspan="2" style="margin-left: 160px; line-height:25px;" align="center" valign="middle">
                        &nbsp;<asp:Button ID="btnSave" runat="server" Text="保存" OnClientClick="return checkPass()"
                            OnClick="btnSave_Click"></asp:Button>
                    </td>
                </tr>
            </table>
        </div>
        <hl:Foot ID="foot1" runat="server" />
    </div>
    </form>
    <script type="text/javascript">
        //移动电话、固定电话、办公电话
        function checkEmailMobile() {
            var txtemail = $("#<%=txtEmail.ClientID %>"); //Email地址
            var txtmoblile = $("#<%=txtMobilePhone.ClientID %>"); //移动电话

            //手机号码
            if (txtmoblile.val().length == 0) {
                if (txtemail.val().length == 0) {
                    alert("Email地址和移动电话至少填写一个!");
                    txtmoblile.focus();
                    return false;
                }
            } else {
                var word1 = /\d{11}/; //手机号码格式/^1\d{10}$/;     
                if ((word1.test(txtmoblile.val())) == false) {
                    alert('手机号码为数字或格式不对！');
                    txtmoblile.focus();
                    return false;
                }
            }
            return true;
        }
        //判断输入的订购数量
        function chekcBookCount(sen) {
            var shuLiang = $("#<%=txtBookCount.ClientID %>"); //订购数量
            var quantityVal = shuLiang.val();
            if (quantityVal == null || quantityVal == "") {
                alert("请您输入购买的商品数量");
                shuLiang.focus();
                return false;
            }
            if ((isNaN(quantityVal) == true)) {//判断输入的是否为数字
                alert("请您输入0~9之间的数字！");
                shuLiang.focus();
                return false;
            }
            if (parseInt(quantityVal) < 1) {
                alert('您输入的商品数量不能小于0！');
                shuLiang.focus();
                return false;
            }
            return true;
        }
        function checkPass() {
            if (checkEmailMobile() && chekcBookCount()) {
                return true;
            } else {
                return false;
            }
        }
    </script>
</body>
</html>
