@{
    ViewBag.Title = "登录界面";
    Layout = "~/Views/Shared/_LayoutTable.cshtml";
}
<head>

</head>
<style>
    .logo-name::after{
        content:"管家婆 物联通";
        width:inherit;
        height:inherit;
    }
    .logo-gname::after{
        content:"管家婆 果易";
        width:inherit;
        height:inherit;
    }
    .logo-sname::after{
        content:"— 指尖上的管理，就这么简单 —";
        width:inherit;
        height:inherit;
    }
</style>

<body style="background-color:rgb(243, 243, 245)">
    @*<canvas id="c_n3" width="508" height="721" style="position: fixed; top: 0px; left: 0px; z-index: -1; opacity: 0.5;"></canvas>*@
    <div class="text-center loginscreen" style="padding-top: 180px;border:1px solid rgb(243, 243, 245);background-color:rgb(243, 243, 245)">
        @*<h1 class="logo-name"  style="color:rgb(68, 139, 203)">
        </h1>*@
        @{
            if (ViewBag.WLTVERSION == "WLTGY")
            {
                <h1 class="logo-gname" style="color:rgb(68, 139, 203)"></h1>
            }
            else
            {
                <h1 class="logo-name" style="color:rgb(68, 139, 203)"></h1>
            }
        }
        <h1 class="logo-sname" style="color:rgb(68, 139, 203)"></h1>
</div>
    <div class="middle-box text-center loginscreen">
        <div>
            <div class="form-group" style="position:relative">
                @*<div style="width:20px;height:20px;background-image:url(../../icon/账套.png);position:absolute;left:-25px;top:10px"></div>
                <select class="form-control" id="DdlZt">
                    @{
                        if (@ViewBag.dt != null && @ViewBag.dt.Rows.Count != 0)
                        {
                            for (int i = 0; i < @ViewBag.dt.Rows.Count; i++)
                            {
                                <option @ViewBag.dt.Rows[i]["ZTname"].ToString()= =@ViewBag.zt ?"selected":"" value="@ViewBag.dt.Rows[i]["ZTname"].ToString(),@ViewBag.dt.Rows[i]["EditionName"].ToString(),@ViewBag.dt.Rows[i]["SqlDatatBase"].ToString(),@ViewBag.dt.Rows[i]["ZTCode"].ToString()" @ViewBag.dt.Rows[i]["ZTname"].ToString()>@ViewBag.dt.Rows[i]["ZTname"].ToString()</option>
                            }
                        }
                    }
                </select>*@
                <div class="input-group">
                    <span class="input-group-addon">
                        <i class="fa fa-folder-open" style="color:rgb(113, 147, 204)"></i>
                    </span>
                    <select class="form-control" id="DdlZt">
                        @{
                            if (@ViewBag.dt != null && @ViewBag.dt.Rows.Count != 0 && @ViewBag.WLTVERSION != "WLTGY")
                            {
                                for (int i = 0; i < @ViewBag.dt.Rows.Count; i++)
                                {
                                    <option @ViewBag.dt.Rows[i]["ZTname"].ToString()= =@ViewBag.zt ?"selected":"" value="@ViewBag.dt.Rows[i]["ZTname"].ToString(),@ViewBag.dt.Rows[i]["EditionName"].ToString(),@ViewBag.dt.Rows[i]["SqlDatatBase"].ToString(),@ViewBag.dt.Rows[i]["ZTCode"].ToString()" @ViewBag.dt.Rows[i]["ZTname"].ToString()>@ViewBag.dt.Rows[i]["ZTname"].ToString()</option>
                                }
                            }
                            else if (@ViewBag.dtgy != null && @ViewBag.dtgy.Rows.Count != 0 && @ViewBag.WLTVERSION == "WLTGY")
                            {
                                for (int i = 0; i < @ViewBag.dtgy.Rows.Count; i++)
                                {
                                    <option @ViewBag.dtgy.Rows[i]["ZTname"].ToString()= =@ViewBag.zt ?"selected":"" value="@ViewBag.dtgy.Rows[i]["ZTname"].ToString(),@ViewBag.dtgy.Rows[i]["EditionName"].ToString(),@ViewBag.dtgy.Rows[i]["SqlDatatBase"].ToString(),@ViewBag.dtgy.Rows[i]["ZTCode"].ToString()" @ViewBag.dtgy.Rows[i]["ZTname"].ToString()>@ViewBag.dtgy.Rows[i]["ZTname"].ToString()</option>
                                }
                            }
                        }
                    </select>
                </div>
            </div>
            <div class="form-group" style="position:relative">
                    <div class="input-group">
                        <span class="input-group-addon">
                            <i class="fa fa-user" style="color:rgb(113, 147, 204)"></i>
                        </span>
                        <input type="text" id="txtLoginName" class="form-control" placeholder="请输入用户名" value="超级用户">
                    </div>
                @*<div style="width:20px;height:20px;background-image:url(../../icon/用户.png);position:absolute;left:-25px;top:10px"></div>
                <input type="text" class="form-control"  id="txtLoginName" placeholder="用户名" value="超级用户" >*@
            </div>
            <div class="form-group" style="position:relative">
                    @*<div style="width:20px;height:20px;background-image:url(../../icon/密码.png);position:absolute;left:-25px;top:10px"></div>
                    <input type="password" class="form-control" id="txtLoginPwds"  placeholder="密码">*@
                <div class="input-group">
                    <span class="input-group-addon">
                        <i class="fa fa-pencil" style="color:rgb(113, 147, 204)"></i>
                    </span>
                    <input type="password" class="form-control" id="txtLoginPwds" placeholder="密码">
                </div>
            </div>
            <span type="button" id="btnLogin" class="btn btn-primary btn-sm btn-block" data-ripple>登 录</span>
            <p id="plog" class="text-muted text-center" style="margin-top:10px">
                当前版本号 V7.0.1(2017-08-14)
            </p>
        </div>
    </div>
</body>
<script type="text/javascript">
    $(function () {
        //初始化点击冲击波效果
        Array.prototype.forEach.call(document.querySelectorAll('[data-ripple]'), function (element) {
            new RippleEffect(element);
        });
        $("#btnLogin").on("click", function () {
            var info = $("#DdlZt").val().split(',');
            var data = { username: "", password: "", editionName: "", dBName: "", ztcode: "" };
            data.username = $("#txtLoginName").val();
            data.password = $("#txtLoginPwds").val();
            data.zt = info[0];
            data.editionName = info[1];
            data.dBName = info[2];
            data.ztcode = info[3];
            doAjax("post", '@Url.Action("getLogin", "Login")', data, false, function (msg) {
                if (msg.result) {
                    $("#plog").html("登录成功，正在跳转......");
                    window.location.href = '@Url.Action("Default", "Home")';
                }
                else {
                    layer.msg("登录名或密码错误！", { time: 2000 })
                }
            });
        });
    })
    document.onkeydown = function (event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e.keyCode == 13) {
            $("#btnLogin").click();
        }
    }
</script>