Exemplo n.º 1
2
 private LoginEntity LoginModeltoLoginEntity(LoginModel model)
 {
     LoginEntity entity = new LoginEntity();
     entity.Email = model.User;
     entity.Senha = Crypto.MD5(model.Password);
     entity.Novo = model.Novo;
     return entity;
 }
Exemplo n.º 2
0
        public DataTable EfetuaLogin(LoginEntity entity)
        {
            try
            {
                CriarConexao();
                Abrir();
                SqlDataAdapter Cmd = new SqlDataAdapter("BuscaLogin",con);

                Cmd.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;

                Cmd.SelectCommand.Parameters.Add("@USUARIO", SqlDbType.VarChar).Value = entity.Email;
                Cmd.SelectCommand.Parameters.Add("@SENHA", SqlDbType.VarChar).Value = entity.Senha;

                DataTable data = new DataTable();

                Cmd.Fill(data);

                return data;

            }
            catch(Exception e)
            {

            }

            return null;
        }