Esempio n. 1
0
        public static UserPermission CheckUserAndPermissions(string password, string name)
        {
            int id = UserDAL.GetByPassword(password, name);

            if (id != -1)
            {
                user_permissions_tbl user   = UserDAL.GetUserPermissions(id);
                tenant_tbl           tenant = TenantDAL.GetById(id);
                return(new UserPermission
                {
                    Id = id,
                    Permission = user?.permission_id ?? -1,
                    BuildingId = tenant?.building_id ?? -1
                });
            }
            return(new UserPermission()
            {
                Id = -1, Permission = -1, BuildingId = -1
            });
        }
Esempio n. 2
0
 public static Tenant GetById(int id)
 {
     return(TenantConverter.ToDTO(TenantDAL.GetById(id)));
 }