private void btnLogin_Click(object sender, RoutedEventArgs e) { //loggin in. Model.DAO.DAOUser uDAO = new Model.DAO.DAOUser(); Model.TOUser tUser = new Model.TOUser(); tUser = uDAO.Login(txtUser.Text, psbPassword.Password.ToString()); if (tUser.Id != 0) { ACTHome home = new ACTHome(tUser); ACTMessages message = new ACTMessages(tUser, "eBuy", "Bem-vindo ao eBuy, " + tUser.Name + "!", 1); message.ShowDialog(); home.Show(); this.Close(); } else { ACTMessages message = new ACTMessages(tUser, "eBuy", "Algo errado aconteceu durante o login.", 3); message.ShowDialog(); } }