PageRenderTime 41ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/website/asp/front/login.aspx.cs

https://github.com/panmingzhi815/SchoolManagementSystem
C# | 47 lines | 44 code | 3 blank | 0 comment | 8 complexity | 39d61e75206fd2284785014d74f20e3e MD5 | raw file
Possible License(s): LGPL-2.1
  1. using System;
  2. using System.Collections;
  3. using System.Configuration;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Security;
  8. using System.Web.UI;
  9. using System.Web.UI.HtmlControls;
  10. using System.Web.UI.WebControls;
  11. using System.Web.UI.WebControls.WebParts;
  12. using System.Xml.Linq;
  13. using DataService.service.dao;
  14. using Domain.Entities;
  15. namespace Domain.asp.front
  16. {
  17. public partial class login : System.Web.UI.Page
  18. {
  19. protected void Page_Load(object sender, EventArgs e)
  20. {
  21. }
  22. protected void LoginBtn_Click(object sender, EventArgs e)
  23. {
  24. if (Sn.Value == "") {
  25. ErrorInfos.InnerHtml = "用户名不能为空";
  26. return;
  27. }
  28. else if (Password.Value == "") {
  29. ErrorInfos.InnerHtml = "密码不能为空";
  30. return;
  31. }
  32. StudentService ss = new StudentService();
  33. Student s = ss.login(Sn.Value, Password.Value);
  34. if (s == null)
  35. {
  36. ErrorInfos.InnerHtml = "用户名或密码错误";
  37. }
  38. else {
  39. Session["user"] = s;
  40. Response.Redirect("index.aspx");
  41. }
  42. }
  43. }
  44. }