<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ADAuth.aspx.cs" Inherits="SmartLogonServer.ADAuth" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="Content/jquery-1.9.1.min.js"></script>
<link href="Bootstrap/css/bootstrap.min.css" rel="stylesheet"/> 
    <link href="Content/toastr/toastr.min.css"  rel="stylesheet" />
<script src="Bootstrap/js/bootstrap.min.js"></script>

            <script src="Content/toastr/toastr.min.js"></script>
        <script src="Content/sweetalert/sweetalert.min.js"></script>
    <title></title>
</head>
<body>
     <div class="panel-body" style="padding-bottom:0px;">
                             <div class="row" style="padding:10px;">
                        <div class="col-md-2"></div>
                        <div class="col-md-4">
                            <%=GetString("C0019") %><br/><%=GetString("C0020") %>
                        </div>
                    </div>
      
                    <div class="row" style="padding:10px;">
                        <label class="control-label col-md-2"><%=GetString("D0099") %></label>
                        <div class="col-md-4">
                            <input type="text" name="edtUserOldPwd" id="edtUserOldPwd" class="form-control" placeholder=<%=GetQuoteString("D0002") %>/>
                        </div>
                    </div>
                    <div class="row" style="padding:10px;">
                        <label class="control-label col-md-2"><%=GetString("D0100") %></label>
                        <div class="col-md-4">
                           <input type="password" name="edtUserPwd1" id="edtUserPwd1" class="form-control" placeholder=<%=GetQuoteString("D0003") %>/>
                        </div>
                    </div>
                       <div class="row" style="padding:10px;">
                        <label class="control-label col-md-2"><%=GetString("D0101") %></label>
                        <div class="col-md-4">
                           <input type="password" name="edtUserPwd2"  id="edtUserPwd2" class="form-control" placeholder=<%=GetQuoteString("D0003") %>/>
                        </div>
                    </div>
                    
                     <div class="row" style="padding:10px;">
                      <div class="col-md-2"></div>
                        <div class="col-md-4">
                            <button type="button" id="btn_changepwdsave" class="btn btn-primary col-md-4"><%=GetString("B0046") %></button>
                        </div>
                    </div>
         </div>


    <script type="text/javascript">
        $("#btn_changepwdsave").on('click', function () {
            //弹出模态框
           

            var userold= $("#edtUserOldPwd").val().trim();
            var userpwd1 = $("#edtUserPwd1").val();
            var userpwd2 = $("#edtUserPwd2").val();


            if ((userpwd1 != userpwd2) || (userpwd1 == "")) {
                toastr.error(<%=GetQuoteString("D0091") %>);
                return;
            }


            $.ajax({
                type: "post",
                url: "ADAuthEdit.ashx",
                data: {
                    userold: userold,
                    userpwd1: userpwd1

                },
                dataType: 'JSON',
                success: function (data, status) {

                    if (status == "success") {
                        if (data.result == true) {
                            toastr.success(<%=GetQuoteString("C0005") %>);
                        }
                        else {
                            toastr.error(<%=GetQuoteString("C0006") %>);
                        }
                    }
                },
                error: function () {
                    toastr.error(<%=GetQuoteString("C0006") %>);
                },
                complete: function () {

                }

            });

            //给弹出框里面的各个文本框赋值
            $("#edtUserPwd1").val();
            $("#edtUserPwd2").val();
            $("#edtUserOldPwd").val();

        });

        toastr.options.positionClass = 'toast-top-center';
</script>
</body>
</html>
