diff --git a/app/src/main/java/com/example/depanntout/ClientDetails.kt b/app/src/main/java/com/example/depanntout/ClientDetails.kt index 6f550e7..309a89c 100644 --- a/app/src/main/java/com/example/depanntout/ClientDetails.kt +++ b/app/src/main/java/com/example/depanntout/ClientDetails.kt @@ -1,10 +1,18 @@ package com.example.depanntout import android.os.Bundle +import android.util.Log +import android.widget.Button import androidx.activity.enableEdgeToEdge import androidx.appcompat.app.AppCompatActivity import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.depanntout.bdd.CreateBdDepannTout +import com.example.depanntout.bdd.DAO +import com.example.depanntout.bdd.Intervention +import com.example.depanntout.bdd.InterventionDAO class ClientDetails : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { @@ -18,5 +26,21 @@ class ClientDetails : AppCompatActivity() { } val client: Client = Client(intent.getIntExtra("ID", 0), intent.getStringExtra("FIRSTNAME")!!, intent.getStringExtra("LASTNAME")!!, intent.getStringExtra("MAIL")!!, intent.getStringExtra("TEL")!!, intent.getStringExtra("ADRESSE")!!) + + val recyclerView = findViewById(R.id.recyclerViewDetails) + recyclerView.layoutManager = LinearLayoutManager(this) + + val createBdDepannTout: CreateBdDepannTout = CreateBdDepannTout(this) + val dao: DAO = DAO(this, createBdDepannTout) + val interventionDAO : InterventionDAO = InterventionDAO(dao) + val interventions: List = interventionDAO.getInterventionsOfClient(client) + + val adapter = interventionAdapter(interventions, this) + recyclerView.adapter = adapter + + val buttonExit = findViewById