protected void submitButton_Click(object sender, EventArgs e) { using (var timer = new FunctionTimer("_Default submiteButton_Click", x => timerLabel.Text = x)) { User user; using (IRepository<User> repository = DomainContext.ServiceLocator.GetInstance<IRepositoryFactory>().GetRepository<User>()) { user = repository.Where(u => u.Username == username.Text).FirstOrDefault(); } if (user != null) { if (user.CheckPassword(password.Text)) { if ((user.HasEmailBeenConfirmed ?? false)) { ((TulsaTechFest) this.Master).SetNotice("user access granted"); } else { ((TulsaTechFest) this.Master).SetError("e-mail not yet confirmed"); } } else { ((TulsaTechFest) this.Master).SetError(string.Format("Invalid password specified for user '{0}'", username.Text)); } } else { ((TulsaTechFest) this.Master).SetError(string.Format("User not found: '{0}'", username.Text)); } } }
protected void submitButton_Click(object sender, EventArgs e) { using (var timer = new FunctionTimer("Registration submiteButton_Click", x => timerLabel.Text = x)) { var msg = new RegisterUser(CombGuid.Generate(), inputName.Text, inputUsername.Text, inputPassword.Text, inputEmail.Text); DomainContext.Publish(msg); ((TulsaTechFest) Master).SetNotice("Thanks! You should receive an email shortly."); submitButton.Enabled = false; } }