예제 #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="imagem"></param>
        /// <param name="loops"></param>
        /// <returns></returns>
        public double[,] GerarArray(Bitmap imagem, int loops)
        {
            ConversaoHelper helper = new ConversaoHelper();

            this._imagem = helper.Binary(imagem);

            if (loops < 1)
                throw new InvalidOperationException("Quantidade de loops precisa ser igual ou maior que 1");

            ConverterParaMatriz();

            ConverterMatrizParaInteiros();

            for(int x = 0; x < loops; x++)
                RemoverRuidos();

            return _matriz;
        }
예제 #2
0
        public UsuarioLogadoViewModel ValidarLogin(LoginFormViewModel model, TipoArea area)
        {
            var login   = ConversaoHelper.ToInt64(model.Login);
            var usuario = (from x in _usuarioRepository.Get()
                           where x.Cpf == login
                           select new
            {
                x.CargoId,
                FirstName = x.Nome,
                UserId = x.Id,
                x.Senha,
                x.DtInativacao,
                x.PerfilAcessoId
            }).FirstOrDefault();

            if (usuario == null)
            {
                throw new Exception("Usuário não existe!");
            }

            if (usuario.DtInativacao != null)
            {
                throw new Exception("Usuário inativo!");
            }

            var senhaCriptografada = CriptografiaHelpers.Criptografar(model.Senha, model.Login);

            if (!usuario.Senha.SequenceEqual(senhaCriptografada))
            {
                throw new Exception("Senha inválida!");
            }

            return(new UsuarioLogadoViewModel
            {
                UserId = usuario.UserId,
                FirstName = usuario.FirstName,
                Roles = _permissaoApp.PermissoesString(usuario.PerfilAcessoId)
            });
        }
예제 #3
0
파일: OndaHelper.cs 프로젝트: alaorneto/ECG
        /// <summary>
        /// 
        /// </summary>
        private void ConverterParaEscalaDeCinza()
        {
            ConversaoHelper helper = new ConversaoHelper();

            this.Bitmap = helper.GrayScale(this.Bitmap);
        }
예제 #4
0
파일: OndaHelper.cs 프로젝트: alaorneto/ECG
        /// <summary>
        /// 
        /// </summary>
        private void ConverterParaBinario()
        {
            ConversaoHelper helper = new ConversaoHelper();

            this.Bitmap = helper.Binary(this.Bitmap);
        }