private void LoginApplication() { try { var username = editUsername.Text; var password = editPassword.Text; var account = new AccountDto(); account.Username = username; account.Password = password; var viewModel = new AccountViewModel(); var accountAuthenticated = viewModel.Authenticate(account); if (accountAuthenticated != null) { SessionManager.Login(Context, accountAuthenticated); Context.Redirect("cantieri-homepage.aspx"); } else { lblLoginFault.Visible = true; } } catch (Exception ex) { UtilityError.Write(ex); } }
private void LoginApplication() { try { var username = editUsername.Text; var password = editPassword.Text; var account = new AccountDto(); account.Username = username; account.Password = password; var viewModel = new AccountViewModel(); var accountAuthenticated = viewModel.Authenticate(account); if (accountAuthenticated!=null) { SessionManager.Login(Context, accountAuthenticated); Context.Redirect("cantieri-homepage.aspx"); } else { lblLoginFault.Visible = true; } } catch (Exception ex) { UtilityError.Write(ex); } }