Beispiel #1
0
        private BE.Models.User ToUser(DAL.User userEntity)
        {
            BE.Models.User newUser = new BE.Models.User();

            newUser.id       = userEntity.id;
            newUser.nombre   = userEntity.nombre;
            newUser.password = userEntity.password;
            newUser.email    = userEntity.email;
            newUser.apellido = userEntity.apellido;

            return(newUser);
        }
Beispiel #2
0
        private DAL.User ToUserEntity(BE.Models.User user)
        {
            DAL.User newUser = new DAL.User();

            newUser.id     = user.id;
            newUser.nombre = user.nombre;

            if (!string.IsNullOrEmpty(user.password))
            {
                newUser.password = EncryptHelper.Encrypt(user.password);
            }

            newUser.email    = user.email;
            newUser.apellido = user.apellido;

            return(newUser);
        }
Beispiel #3
0
        public BE.Models.User GetUserById(int id)
        {
            try
            {
                DAL.User       dataUser = new DaoUser().GetUserById(id);
                BE.Models.User user     = null;
                if (dataUser != null)
                {
                    user = ToUser(dataUser);
                }



                return(user);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Beispiel #4
0
 public void InsertUser(BE.Models.User user)
 {
     new DaoUser().InsertUser(ToUserEntity(user));
 }
Beispiel #5
0
 public void UpdateUser(BE.Models.User user)
 {
     new DaoUser().UpdateUser(ToUserEntity(user));
 }