1
0
mirror of https://e.coding.net/circlecloud/CitySunlight.git synced 2024-12-04 12:58:46 +00:00

移除模态窗口...

This commit is contained in:
j502647092 2015-06-23 18:37:55 +08:00
parent b081641231
commit 2d7826865f
5 changed files with 50 additions and 75 deletions

Binary file not shown.

View File

@ -17,6 +17,11 @@
<title>都市阳光销售系统</title> <title>都市阳光销售系统</title>
</head> </head>
<script>
function login_Click() {
$('#loginModal').modal('hide')
}
</script>
<body> <body>
<!-- Fixed navbar --> <!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
@ -55,79 +60,6 @@
</div> </div>
</div> </div>
<!-- /container --> <!-- /container -->
<!-- 模态框Modal -->
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" id="myModalLabel">都市阳光登录
</h4>
</div>
<div class="modal-body">
在这里添加一些文本
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">
关闭
</button>
<button type="button" class="btn btn-primary">
登录
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<%-- <!-- 模态框Modal -->
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" id="myModalLabel">都市阳光登录
</h4>
</div>
<div class="modal-body">
<div class="form-control">
<%= getAlert(msg) %>
<label for="UserNameTx" class="col-sm-3"><a class="glyphicon glyphicon-user">用户名</a></label>
<input type="text" id="UserNameTx" name="UserNameTx" class="form-control col-sm-7" placeholder="请输入账号" />
<label for="PassWordTx" class="col-sm-3"><a class="glyphicon glyphicon-th">密 码</a></label>
<input type="password" id="PassWordTx" name="PassWordTx" class="form-control col-sm-7" placeholder="请输入密码" />
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">
关闭
</button>
<button type="button" class="btn btn-primary">
提交更改
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->--%>
<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.js"></script> <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.js"></script> <script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.js"></script>
</body> </body>

View File

@ -36,5 +36,48 @@ namespace CitySunlight
html += "{1}</div>"; html += "{1}</div>";
return (msg == null || msg == "") ? "" : String.Format(html, "danger", msg); return (msg == null || msg == "") ? "" : String.Format(html, "danger", msg);
} }
protected void login_Click(object sender, EventArgs e)
{
//String username = UserNameTx.Value;
String password = HttpUtils.getElementsbyName("PassWordTx");
String username = HttpUtils.getElementsbyName("UserNameTx");
login(username, password);
}
public bool login(String username, String password)
{
if ((username == null) || (password == null))
{
return false;
}
if ((username.Length == 0) || (password.Length == 0))
{
msg = "请填写完整的账号和密码!";
return false;
}
if (!UserManager.isExist(username))
{
msg = "当前用户不存在!";
return false;
}
if (UserManager.GetTimes(username) > 2)
{
msg = "登录错误超过3次,已被锁定,请联系管理员!";
return false;
}
if (UserManager.LoginUser(username, password))
{
Session["username"] = username;
return true;
}
else
{
msg = "账号密码错误,还可以尝试" + (4 - UserManager.GetTimes(username)) + "次..!";
return false;
}
}
} }
} }