Exemplo n.º 1
0
        public void TestEditUserCareer()
        {
            UserCareer userCareer = UserCareerBrl.Get(1, content);
            User       user       = UserBrl.Get(2, content);

            userCareer.User = user;
            //UserCareerBrl.Update(userCareer, content);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void InsertUser(User user)
 {
     try
     {
         UserBrl.Insertar(user, dbcontex);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public void Delete(long id)
 {
     try
     {
         UserBrl.Delete(id, dbcontex);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
 public void Update(UserDto personDto)
 {
     try
     {
         UserBrl.Update(personDto, dbcontex);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 6
0
 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;
     }
 }
Exemplo n.º 8
0
        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();
                }
            }
        }
Exemplo n.º 9
0
        public UserDto Get(long id)
        {
            UserDto personDto = null;

            try
            {
                personDto = UserBrl.GetDto(id, dbcontex);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(personDto);
        }
Exemplo n.º 10
0
        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));
        }
Exemplo n.º 11
0
        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));
        }