Communication between layers

1

I have 3 layers, BLL, DAL and Project. In the DAL layer is ENTITY (automatically creates the GETs and SETs) and I want to use the GETs and SETs

Because when the project layer arrives the value is "0".

Maybe it's a bit confusing to ask the BLL code and the PROJECT has a commented line to help you understand the problem.

DAL Layer

namespace DAL
{
using System;
using System.Collections.Generic;

public partial class TabUsuario
{
    public int UsuarioId { get; set; }
    public string Login { get; set; }
    public string Senha { get; set; }
    public string Nome { get; set; }
    public string Email { get; set; }
    public int PerfilId { get; set; }
    public bool Status { get; set; }
    public System.DateTime DataCriacao { get; set; }

    public virtual TabPerfil TabPerfil { get; set; }
}

}

BLL layer is the login class

TabUsuario DALUsuario = new TabUsuario();

public void Login(string Usuario, string Password)
    {
        bool exite = db.TabUsuario.Any(m => m.Login == Usuario && m.Senha == Password && m.Status == true);
        if (exite == true)
        {
            //AQUI O VALOR PASSA NORMAL , O PerfilId FICA COM VALOR 1
            DALUsuario.PerfilId = db.TabUsuario.Where(m => m.Login == Usuario).Select(m => m.PerfilId).FirstOrDefault(); 
        }

        verificacao = exite;
    } 

Project Layer I have

TabUsuario DALUsuario = new TabUsuario();

if (Usuarios.Verificacao == true)
        {
            lblLogado.Visible = true;
            lblLogado.Text = "Logado com Sucesso.!";
            //AQUI O VALOR NÃO CHEGA , O PerfilId FICA COM VALOR 0
            Session.Add("PerfilUsuario", DALUsuario.PerfilId);
        }
    
asked by anonymous 23.02.2016 / 14:29

0 answers