diff --git a/CitySunlight/Basic.Master.cs b/CitySunlight/Basic.Master.cs
index 7455ffe..c60e8a0 100644
--- a/CitySunlight/Basic.Master.cs
+++ b/CitySunlight/Basic.Master.cs
@@ -18,7 +18,6 @@ namespace CitySunlight
{
String html = "";
if (Session["username"] == null)
- //html = "
登录";
html = "登录";
else
{
@@ -29,55 +28,5 @@ namespace CitySunlight
}
return html;
}
- public String getAlert(String msg)
- {
- String html = "";
- html += "";
- html += "{1}
";
- 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;
- }
- }
}
}
\ No newline at end of file