public void TestEditUserCareer() { UserCareer userCareer = UserCareerBrl.Get(1, content); User user = UserBrl.Get(2, content); userCareer.User = user; //UserCareerBrl.Update(userCareer, content); }
public void TestCreateUserCareer() { UserCareer userCareer = new UserCareer(); User user = UserBrl.Get(1, content); Career career = CareerBrl.Get(1, content); userCareer.Career = career; userCareer.User = user; //UserCareerBrl.Insertar(userCareer, content); }
public void InsertUser(User user) { try { UserBrl.Insertar(user, dbcontex); } catch (Exception ex) { throw ex; } }
public void Delete(long id) { try { UserBrl.Delete(id, dbcontex); } catch (Exception ex) { throw ex; } }
public void Update(UserDto personDto) { try { UserBrl.Update(personDto, dbcontex); } catch (Exception ex) { throw ex; } }
public void Insert(UserDto userDto) { try { UserBrl.Insertar(userDto, dbcontex); } catch (Exception ex) { throw ex; } }
public List <UserDto> GetAll() { try { return(UserBrl.GetAll(dbcontex)); } catch (Exception ex) { throw ex; } }
private void btnIngresar_Click(object sender, RoutedEventArgs e) { if (txtNombreUsuario.Text != "" && txtPassword.Password != "") { try { if (!LoginDal.ExisteUsuario(txtNombreUsuario.Text, txtPassword.Password)) { tbkDetalle.Text = "Intente De Nuevo :)"; cont++; txtNombreUsuario.Clear(); txtPassword.Clear(); txtNombreUsuario.Focus(); if (cont > 3) { MessageBox.Show("Demasiado intentos"); this.Close(); } return; } else { User usuario = UserBrl.ObtenerIdUsuario(txtNombreUsuario.Text); if (usuario.PasswordState == 1) { MessageBox.Show("Es necesario Cambiar password"); } else if (usuario.PasswordState == 0) { User usuarioSession = UserBrl.ObtenerSession(txtNombreUsuario.Text, txtPassword.Password); MenuInicio menuPrincipal = new MenuInicio(usuarioSession); menuPrincipal.Show(); this.Close(); } } } catch (Exception ex) { throw ex; } } else { tbkDetalle.Text = "Es necesario llenar los campos"; cont++; if (cont > 3) { MessageBox.Show("Demasiado intentos"); this.Close(); } } }
public UserDto Get(long id) { UserDto personDto = null; try { personDto = UserBrl.GetDto(id, dbcontex); } catch (Exception ex) { throw ex; } return(personDto); }
public void TestChangePassword() { UserDto currentUser = new UserDto() { Email = "*****@*****.**", Password = new PasswordDto() { Psw = "hola" }, UserId = 50 }; UserBrl.Insert(currentUser, container); PasswordDto user = new PasswordDto() { PasswordId = 50, NewPassword = "******", Psw = "hola" }; Assert.Equals(true, UserLoginBrl.ChangePassword(user, container)); }
public void TestLogin() { UserDto user = new UserDto() { Email = "*****@*****.**", Password = new PasswordDto() { Psw = "hola" } }; UserDto currentUser = new UserDto() { Email = "*****@*****.**", Password = new PasswordDto() { Psw = "hola" } }; UserBrl.Insert(currentUser, container); Assert.Equals(true, UserLoginBrl.Login(user, container)); }