慕容3067478
private void btnLogin_Click(object sender, System.EventArgs e){try{string userName=txtUserName.Text;string password=txtPassword.Text;if(userName.Equals(\"\")){lbWarning.Text=TextProvider.GetTextProvider().GetText(\"login.need.username\");return;}if(password.Equals(\"\")){lbWarning.Text=TextProvider.GetTextProvider().GetText(\"login.need.password\");return;}IWindsorContainer container = ContainerWebAccessorUtil.ObtainContainer();IUserMgr userMgr=(IUserMgr)container[\"userMgr\"];User u=userMgr.Login(userName,password);if(u==null){lbWarning.Text=TextProvider.GetTextProvider().GetText(\"login.error\");return;}else{//lbWarning.Text=\"login ok!\";userMgr.DoUpdateLastLoginTime(u.Id);HttpContext.Current.Session[\"User\"] = u;HttpContext.Current.Response.Redirect(\"index.aspx\", true);}}catch(BusiException ex){lbWarning.Text=ex.ShowMessage(ex);}}}}