Login.aspx.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. namespace OThinker.H3.Portal
  12. {
  13.     public partial class Login : OThinker.H3.Portal.PortalPage
  14.     {
  15.         protected void Page_Load(object sender, EventArgs e)
  16.         {
  17.         }
  18.         protected void lgLog_LoggingIn(object sender, LoginCancelEventArgs e)
  19.         {
  20.             string userAlias = this.lgLog.UserName;
  21.             if (userAlias == null)
  22.             {
  23.                 this.NotifyMessage("请输入用户名");
  24.             }
  25.             string userId = OThinker.H3.Server.Engine.Organization.GetUserIDByAlias(userAlias);
  26.             OThinker.Organization.User user = (OThinker.Organization.User)OThinker.H3.Server.Engine.Organization.GetUnit(userId);
  27.             if (user == null)
  28.             {
  29.                 this.NotifyMessage("用户名不存在,请重新输入");
  30.             }
  31.             else if (user.Password != this.lgLog.Password)
  32.             {
  33.                 this.NotifyMessage("用户名密码不匹配");
  34.             }
  35.             else
  36.             {
  37.                 this.Session[OThinker.H3.WorkSheet.Sessions.GetUserValidator()] = UserValidatorFactory.GetValidator(userAlias);
  38.                 string q = HttpUtility.UrlDecode(this.Request.QueryString[Param_Q]);
  39.                 if (q == null || q == "")
  40.                 {
  41.                     this.Response.Redirect("Default.aspx");
  42.                 }
  43.                 else
  44.                 {
  45.                     this.Response.Redirect(q);
  46.                 }
  47.             }
  48.         }
  49.     }
  50. }