projet final
1
app/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
43
app/build.gradle.kts
Normal file
@@ -0,0 +1,43 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.dpanntout"
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.dpanntout"
|
||||
minSdk = 24
|
||||
targetSdk = 35
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
}
|
21
app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@@ -0,0 +1,26 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.dpanntout", appContext.getPackageName());
|
||||
}
|
||||
}
|
42
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.DépannTout"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".ModifierLeClient"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ModifierClient"
|
||||
android:exported="false" />
|
||||
<activity android:name=".creerIntervention" />
|
||||
<activity
|
||||
android:name=".ListeIntervention"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ListeClient"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".CreerClient"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
74
app/src/main/java/bdd/ClientDAO.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package bdd;
|
||||
|
||||
import static bdd.CreateBdDepannTout.TABLE_CLIENT;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.util.Log;
|
||||
|
||||
import metier.Client;
|
||||
import bdd.CreateBdDepannTout;
|
||||
|
||||
public class ClientDAO {
|
||||
private DAO dao = null;
|
||||
private SQLiteDatabase db = null;
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param context
|
||||
*/
|
||||
|
||||
public ClientDAO(Context context){
|
||||
dao = new DAO(context);
|
||||
db = dao.open();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fermeture de la base de données
|
||||
*/
|
||||
|
||||
public void close() {
|
||||
dao.close();
|
||||
}
|
||||
|
||||
public Cursor readLesClients() {
|
||||
String reqSql = "Select id as '_id', nom, prenom, adrMail, numTel, adrPostale FROM " + TABLE_CLIENT +";";
|
||||
// Execution de la requête
|
||||
Cursor c = db.rawQuery(reqSql, null);
|
||||
Log.d("bdd", "le curseur contient " + c.getCount() + " lignes");
|
||||
return c;
|
||||
}
|
||||
|
||||
public long create(Client c) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("nom", c.getNom());
|
||||
values.put("prenom", c.getPrenom());
|
||||
values.put("adrMail", c.getAdrMail());
|
||||
values.put("numTel", c.getNumTel());
|
||||
values.put("adrPostale", c.getAdrPostale());
|
||||
Log.d("bdd", "insert, :" + c);
|
||||
return db.insert(TABLE_CLIENT, null, values);
|
||||
}
|
||||
|
||||
public void deleteClient(int idClient){
|
||||
db.delete("client", "id = ?", new String[]{String.valueOf(idClient)});
|
||||
db.close();
|
||||
}
|
||||
|
||||
|
||||
public void updateClient(int idClient, String nom, String prenom, String adrMail, String numTel, String adrPostale) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("nom", nom);
|
||||
values.put("prenom", prenom);
|
||||
values.put("adrMail", adrMail);
|
||||
values.put("numTel", numTel);
|
||||
values.put("adrPostale", adrPostale);
|
||||
|
||||
db.update("client", values, "id = ?", new String[]{String.valueOf(idClient)});
|
||||
}
|
||||
|
||||
|
||||
}
|
67
app/src/main/java/bdd/CreateBdDepannTout.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package bdd;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class CreateBdDepannTout extends SQLiteOpenHelper {
|
||||
|
||||
public static final String TABLE_CLIENT = "client";
|
||||
public static final String TABLE_INTER = "intervention";
|
||||
private static final String CREATE_TABLE_CLIENT =
|
||||
"CREATE TABLE " + TABLE_CLIENT + "(" +
|
||||
"id INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"nom TEXT NOT NULL, " +
|
||||
"prenom TEXT NOT NULL, " +
|
||||
"adrMail TEXT NOT NULL, " +
|
||||
"numTel TEXT NOT NULL, " +
|
||||
"adrPostale TEXT NOT NULL);";
|
||||
|
||||
private static final String CREATE_TABLE_INTER =
|
||||
"CREATE TABLE " + TABLE_INTER + "(" +
|
||||
"id INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"idCli INTEGER NOT NULL, " +
|
||||
"dateTime TEXT NOT NULL, " +
|
||||
"observation TEXT NOT NULL);";
|
||||
|
||||
// Constructeur, à générer automatiquement
|
||||
public CreateBdDepannTout(@Nullable Context context, @Nullable String name,
|
||||
@Nullable SQLiteDatabase.CursorFactory factory, int version) {
|
||||
super(context, name, factory, version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Création de la base de données si elle n'existe pas
|
||||
*
|
||||
* @param db base
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
db.execSQL(CREATE_TABLE_CLIENT);
|
||||
Log.d("bdd", "table client créée");
|
||||
|
||||
db.execSQL(CREATE_TABLE_INTER);
|
||||
Log.d("bdd", "table intervention créée");
|
||||
}
|
||||
|
||||
/**
|
||||
* Création d'une nouvelle base en cas de changement de version
|
||||
*
|
||||
* @param db
|
||||
* @param oldVersion
|
||||
* @param newVersion
|
||||
*/
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_CLIENT + ";");
|
||||
Log.d("bdd", "Table " + TABLE_CLIENT + " supprimée");
|
||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_INTER + ";");
|
||||
Log.d("bdd", "Table " + TABLE_INTER + " supprimée");
|
||||
onCreate(db);
|
||||
}
|
||||
|
||||
|
||||
}
|
34
app/src/main/java/bdd/DAO.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package bdd;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.util.Log;
|
||||
|
||||
public class DAO {
|
||||
private static final int VERSION_BDD = 2;
|
||||
private static final String NOM_BDD = "bdDepannTout";
|
||||
private CreateBdDepannTout createBd = null;
|
||||
private SQLiteDatabase db = null;
|
||||
|
||||
public DAO(Context context){
|
||||
createBd = new CreateBdDepannTout(context, NOM_BDD, null, VERSION_BDD);
|
||||
Log.d("bdd", "Appel au constructeur de DAO ok, bdd créée");
|
||||
}
|
||||
|
||||
public SQLiteDatabase open(){
|
||||
if (db == null){
|
||||
db = createBd.getWritableDatabase();
|
||||
Log.d("bdd", "Base de données ouverte");
|
||||
} else {
|
||||
Log.d("bdd", "base de données accessible");
|
||||
}
|
||||
return db;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if(db != null){
|
||||
db.close();
|
||||
Log.d("bdd", "Base de données fermée");
|
||||
}
|
||||
}
|
||||
}
|
65
app/src/main/java/bdd/InterventionDAO.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package bdd;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.util.Log;
|
||||
|
||||
import metier.Client;
|
||||
import metier.Intervention;
|
||||
|
||||
public class InterventionDAO {
|
||||
|
||||
private DAO dao = null;
|
||||
private SQLiteDatabase db = null;
|
||||
/**
|
||||
* Constructeur
|
||||
* @param context
|
||||
*/
|
||||
|
||||
public InterventionDAO(Context context){
|
||||
dao = new DAO(context);
|
||||
db = dao.open();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fermeture de la base de données
|
||||
*/
|
||||
|
||||
public void close() {
|
||||
|
||||
dao.close();
|
||||
}
|
||||
|
||||
|
||||
public Cursor readLesInterventions() {
|
||||
String reqSql = "Select id as '_id', idCli as 'idCli', dateTime, observation FROM " + CreateBdDepannTout.TABLE_INTER +";";
|
||||
// Execution de la requête
|
||||
Cursor c = db.rawQuery(reqSql, null);
|
||||
Log.d("bdd", "le curseur contient " + c.getCount() + " lignes");
|
||||
return c;
|
||||
}
|
||||
|
||||
public long create(Intervention i ) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("idCli", i.getIdCli());
|
||||
values.put("dateTime", i.getDateTime());
|
||||
values.put("observation", i.getObservation());
|
||||
Log.d("bdd", "insert, :" + i);
|
||||
return db.insert(CreateBdDepannTout.TABLE_INTER, null, values);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
111
app/src/main/java/com/example/dpanntout/CreerClient.java
Normal file
@@ -0,0 +1,111 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import bdd.ClientDAO;
|
||||
import metier.Client;
|
||||
|
||||
public class CreerClient extends AppCompatActivity {
|
||||
//variables de controle graphique (on les lies avec V du controle graphique du fichier xml)
|
||||
private EditText nomCli;
|
||||
private EditText prenomCli;
|
||||
private EditText melCli;
|
||||
private EditText numCli;
|
||||
private EditText adCli;
|
||||
private Button btnAjt;
|
||||
|
||||
//variables qui vont recuperer les valeurs saisies
|
||||
String saisieNomCLi;
|
||||
String saisiePrenomCli;
|
||||
String saisieMelCli;
|
||||
String saisieNumCli;
|
||||
String saisieAdCli;
|
||||
|
||||
Client client ; //nv client créer avec les nvl valeur
|
||||
long idClientCree; //id unique du client crée
|
||||
|
||||
|
||||
private ClientDAO clientDAO = null; //pour acceder a la bd ClientDAO et avoir acces au methode, on créer un objet clientDAO
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_creer_client);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
Initialisation();
|
||||
CreationClient();
|
||||
}
|
||||
|
||||
private void Initialisation() {
|
||||
//gestion du bouton quitter
|
||||
Button BtQuitP1 = (Button) findViewById(R.id.BtQuitP1);
|
||||
//associer l'evenement quitter au boutton quitter
|
||||
BtQuitP1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
clientDAO.close();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//methode pour créer le nouveau client avec les informations saisies
|
||||
public void CreationClient(){
|
||||
// Reconnaissance des contrôles graphiques de la vue
|
||||
nomCli = (EditText) findViewById(R.id.ptNomCliP1);
|
||||
prenomCli = (EditText) findViewById((R.id.ptPreCliP1));
|
||||
melCli = (EditText) findViewById((R.id.ptmelCliP1));
|
||||
numCli = (EditText) findViewById((R.id.ptNumCliP1));
|
||||
adCli = (EditText) findViewById((R.id.ptAdPoCliP1));
|
||||
btnAjt = (Button) findViewById(R.id.btAjtP1);
|
||||
//acces à la table client
|
||||
clientDAO = new ClientDAO(this);
|
||||
|
||||
// Gestion de l'événement onClick sur le boutn Ajouter
|
||||
btnAjt.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//recuperation des zones de valeurs saisies
|
||||
saisieNomCLi = nomCli.getText().toString();
|
||||
saisiePrenomCli = prenomCli.getText().toString();
|
||||
saisieMelCli = melCli.getText().toString();
|
||||
saisieNumCli = numCli.getText().toString();
|
||||
saisieAdCli = adCli.getText().toString();
|
||||
|
||||
//creation du nv client avec ses valeurs saisies
|
||||
client = new Client(saisieNomCLi, saisiePrenomCli, saisieMelCli, saisieNumCli, saisieAdCli);
|
||||
// Insertion du client dans la base de données
|
||||
long idClientCree = clientDAO.create(client);
|
||||
|
||||
//toast pour afficher un msg a l'ecran
|
||||
Toast.makeText(getApplicationContext(), "Client ajouté + " + "no : " + idClientCree + ")", Toast.LENGTH_SHORT).show();
|
||||
|
||||
//permettre au zone de saisie de s'effacer quand on a enregistrer
|
||||
nomCli.setText("");
|
||||
prenomCli.setText("");
|
||||
melCli.setText("");
|
||||
numCli.setText("");
|
||||
adCli.setText("");
|
||||
} });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
201
app/src/main/java/com/example/dpanntout/ListeClient.java
Normal file
@@ -0,0 +1,201 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SimpleCursorAdapter;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import bdd.ClientDAO;
|
||||
import bdd.InterventionDAO;
|
||||
import metier.Client;
|
||||
|
||||
public class ListeClient extends AppCompatActivity {
|
||||
private int idClientSelectionne = -1;
|
||||
private Client clientSelectionne;
|
||||
|
||||
|
||||
private ClientDAO clientDAO; // Déclare cette variable en haut de la classe.
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_liste_client);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
Initialisation();
|
||||
|
||||
}
|
||||
private void Initialisation() {
|
||||
//gestion du bouton quitter
|
||||
Button btQuitterP2 = (Button) findViewById(R.id.btQuitterP2);
|
||||
//associer l'evenement quitter au boutton quitter
|
||||
btQuitterP2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
//gestion du bouton modifier un client
|
||||
Button btModifP2 = (Button)findViewById(R.id.btModifP2);
|
||||
btModifP2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (verifierClientSelectionne()) {
|
||||
demarrerPageModification();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
afficherLesClients();
|
||||
}
|
||||
|
||||
private void demarrerPageModification () {
|
||||
Intent intent = new Intent(ListeClient.this, ModifierLeClient.class);
|
||||
intent.putExtra("nom", clientSelectionne.getNom());
|
||||
intent.putExtra("prenom", clientSelectionne.getPrenom());
|
||||
intent.putExtra("mail", clientSelectionne.getAdrMail());
|
||||
intent.putExtra("numero", clientSelectionne.getNumTel());
|
||||
intent.putExtra("adresse", clientSelectionne.getAdrPostale());
|
||||
startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
public void afficherLesClients() {
|
||||
Log.d("bdd", "debut afficherLesInterventions");
|
||||
clientDAO = new ClientDAO(this);
|
||||
Cursor c = clientDAO.readLesClients();
|
||||
Log.d("Database", "Nombre de client(s) : " + c.getCount());
|
||||
Toast.makeText(getApplicationContext(), "il y a " + c.getCount() + " clients ", Toast.LENGTH_SHORT).show();
|
||||
clientDAO.close();
|
||||
//nom des 4 attributs lus dans la bdd
|
||||
String[] from = new String[]{"nom", "prenom", "adrMail", "numTel", "adrPostale"};
|
||||
//reference des controles graphiques qui afficheront les valeurs
|
||||
int[] to = new int[]{R.id.tvNomP2_2, R.id.tvPrenomP2_2, R.id.tvMelP2_2, R.id.tvNumP2_2, R.id.tvAdP2_2};
|
||||
//adapter : lien entre les données et les controless graphiques
|
||||
SimpleCursorAdapter dataAdapter = new SimpleCursorAdapter(this, R.layout.ligne_client, c, from, to, 0);
|
||||
ListView lvCli = (ListView) findViewById(R.id.lvCli);
|
||||
lvCli.setAdapter(dataAdapter);
|
||||
|
||||
|
||||
configurerSelectionClient();
|
||||
}
|
||||
|
||||
//methode pour selectionner un client dans la liste et basculer page modif avec ses do
|
||||
private void configurerSelectionClient() {
|
||||
ListView lvCli = findViewById(R.id.lvCli);
|
||||
lvCli.setOnItemClickListener((parent, view, position, id) -> {
|
||||
// Récupération du curseur correspondant à l'élément sélectionné
|
||||
Cursor c = (Cursor) parent.getItemAtPosition(position);
|
||||
|
||||
// On récupère les indices des colonnes
|
||||
int indexNom = c.getColumnIndexOrThrow("nom");
|
||||
int indexPrenom = c.getColumnIndexOrThrow("prenom");
|
||||
int indexMail = c.getColumnIndexOrThrow("adrMail");
|
||||
int indexNumTel = c.getColumnIndexOrThrow("numTel");
|
||||
int indexAdresse = c.getColumnIndexOrThrow("adrPostale");
|
||||
|
||||
// On récupère les valeurs des colonnes
|
||||
String nomClient = c.getString(indexNom);
|
||||
String prenomClient = c.getString(indexPrenom);
|
||||
String mailClient = c.getString(indexMail);
|
||||
String numTelClient = c.getString(indexNumTel);
|
||||
String adresseClient = c.getString(indexAdresse);
|
||||
|
||||
// On affiche ces infos pour le débogage
|
||||
Toast.makeText(getApplicationContext(), "Client sélectionné : " + nomClient + " " + prenomClient, Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Passage de toutes les données à la page de modification
|
||||
Intent intent = new Intent(ListeClient.this, ModifierLeClient.class);
|
||||
intent.putExtra("idClient", (int) id); // Passer l'ID du client
|
||||
intent.putExtra("nom", nomClient);
|
||||
intent.putExtra("prenom", prenomClient);
|
||||
intent.putExtra("mail", mailClient);
|
||||
intent.putExtra("numTel", numTelClient);
|
||||
intent.putExtra("adresse", adresseClient);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean verifierClientSelectionne() {
|
||||
if (idClientSelectionne == -1) {
|
||||
Toast.makeText(this, "Sélectionnez d'abord un client à modifier ", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,72 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SimpleCursorAdapter;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import bdd.ClientDAO;
|
||||
import bdd.InterventionDAO;
|
||||
|
||||
public class ListeIntervention extends AppCompatActivity {
|
||||
|
||||
private InterventionDAO interventionDAO; // Déclare cette variable en haut de la classe.
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_liste_intervention);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
Initialisation();
|
||||
}
|
||||
|
||||
private void Initialisation() {
|
||||
//gestion du bouton quitter
|
||||
Button tvBtQuitP3 = (Button) findViewById(R.id.tvBtQuitP3);
|
||||
//associer l'evenement quitter au boutton quitter
|
||||
tvBtQuitP3.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
afficherLesInterventions();
|
||||
}
|
||||
|
||||
|
||||
public void afficherLesInterventions(){
|
||||
Log.d("bdd", "debut afficherLesInterventions");
|
||||
interventionDAO = new InterventionDAO(this );
|
||||
Cursor c = interventionDAO.readLesInterventions();
|
||||
Log.d("Database", "Nombre d'interventions(s) : " + c.getCount());
|
||||
Toast.makeText(getApplicationContext(), "il y a " + c.getCount() + " interventions ", Toast.LENGTH_SHORT).show();
|
||||
interventionDAO.close();
|
||||
//nom des 4 attributs lus dans la bdd
|
||||
String[] from = new String[]{"idCli", "dateTime", "observation"};
|
||||
//reference des controles graphiques qui afficheront les valeurs de la page ligne_intervention
|
||||
int [] to = new int[] {R.id.tvIdCliInter3_3 , R.id.tvDateInter3_3, R.id.tvobsInter3_3 };
|
||||
//adapter : lien entre les données et les controless graphiques
|
||||
SimpleCursorAdapter dataAdapter = new SimpleCursorAdapter(this , R.layout.ligne_intervention, c, from,to,0);
|
||||
ListView lvInter = (ListView) findViewById(R.id.lvInter);
|
||||
lvInter.setAdapter(dataAdapter);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
83
app/src/main/java/com/example/dpanntout/MainActivity.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_main);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
Initialisation();
|
||||
}
|
||||
|
||||
|
||||
private void Initialisation() {
|
||||
Button tvBtMenuAdCli = (Button) findViewById(R.id.tvBtMenuAdCli);
|
||||
tvBtMenuAdCli.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
demarrerPageCreerClient();
|
||||
}
|
||||
});
|
||||
Button tvBtMenuListCli = (Button)findViewById(R.id.tvBtMenuListCli);
|
||||
tvBtMenuListCli.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
demarrerPageListeClient();
|
||||
}
|
||||
});
|
||||
Button tvBtMenuAdInter = (Button)findViewById(R.id.tvBtMenuAdInter);
|
||||
tvBtMenuAdInter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
demarrerPageCreerInter();
|
||||
}
|
||||
});
|
||||
|
||||
Button tvBtMenuListInter = (Button)findViewById(R.id.tvBtMenuListInter);
|
||||
tvBtMenuListInter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
demarrerPageListeinter();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//methode utilise Intent pour demarrer la page
|
||||
private void demarrerPageCreerClient () {
|
||||
Intent intent = new Intent(MainActivity.this, CreerClient.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void demarrerPageListeClient(){
|
||||
Intent intent = new Intent(MainActivity.this, ListeClient.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void demarrerPageCreerInter(){
|
||||
Intent intent = new Intent(MainActivity.this, creerIntervention.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void demarrerPageListeinter(){
|
||||
Intent intent = new Intent(MainActivity.this, ListeIntervention.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
141
app/src/main/java/com/example/dpanntout/ModifierLeClient.java
Normal file
@@ -0,0 +1,141 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import static bdd.CreateBdDepannTout.TABLE_CLIENT;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import bdd.ClientDAO;
|
||||
import bdd.CreateBdDepannTout;
|
||||
|
||||
|
||||
public class ModifierLeClient extends AppCompatActivity {
|
||||
// private CreateBdDepannTout bdDepannTout;
|
||||
private int idClient;
|
||||
private String nv_nom , nv_prenom, nv_mail, nv_tel, nv_adr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_modifier_le_client);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
Initialisation();
|
||||
initialiserChampsClient();
|
||||
idClient = getIntent().getIntExtra("idClient", -1); // -1 si problème
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void Initialisation() {
|
||||
//gestion du bouton quitter
|
||||
Button btQuitP5 = (Button) findViewById(R.id.btQuitP5);
|
||||
//associer l'evenement quitter au boutton quitter
|
||||
btQuitP5.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
Button btSupCli = (Button) findViewById(R.id.btSupCli);
|
||||
btSupCli.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// appel methode pour supprimer le client
|
||||
supprimerClient();
|
||||
}
|
||||
});
|
||||
Button btSaveModif = (Button) findViewById(R.id.btSaveModif);
|
||||
btSaveModif.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// appel methode pour supprimer le client
|
||||
modifierCLient();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//methode qui permet d'afficher dans les champs les données du cli selectionner
|
||||
private void initialiserChampsClient() {
|
||||
// Récupérer les données envoyées par l'intent
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
String nom = intent.getStringExtra("nom");
|
||||
String prenom = intent.getStringExtra("prenom");
|
||||
String mail = intent.getStringExtra("mail");
|
||||
String numero = intent.getStringExtra("numTel");
|
||||
String adresse = intent.getStringExtra("adresse");
|
||||
|
||||
// Relier les EditText avec fiche id fichier xml modifier client
|
||||
EditText etNom = findViewById(R.id.NomCliModif);
|
||||
EditText etPrenom = findViewById(R.id.preCliModif);
|
||||
EditText etMail = findViewById(R.id.melCliModif);
|
||||
EditText etNumero = findViewById(R.id.numCliModif);
|
||||
EditText etAdresse = findViewById(R.id.addModif);
|
||||
|
||||
// Remplir les EditText
|
||||
etNom.setText(nom);
|
||||
etPrenom.setText(prenom);
|
||||
etMail.setText(mail);
|
||||
etNumero.setText(numero);
|
||||
etAdresse.setText(adresse);
|
||||
}
|
||||
}
|
||||
public void supprimerClient(){
|
||||
ClientDAO client = new ClientDAO(this);
|
||||
client.deleteClient(idClient); // appel de la methode presente dans ClientDAO
|
||||
Toast.makeText(this, "Client supprimé", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
|
||||
public void modifierCLient(){
|
||||
// On récupère les champs de texte (les EditText) à l'écran, où l'utilisateur a tapé les infos
|
||||
EditText etNom = findViewById(R.id.NomCliModif);
|
||||
EditText etPrenom = findViewById(R.id.preCliModif);
|
||||
EditText etMail = findViewById(R.id.melCliModif);
|
||||
EditText etNumero = findViewById(R.id.numCliModif);
|
||||
EditText etAdresse = findViewById(R.id.addModif);
|
||||
// On transforme le texte saisi par l'utilisateur (EditText) en vraie chaîne de caractères (String)
|
||||
// C’est ce qu’on va envoyer à la base de données
|
||||
String nom = etNom.getText().toString();
|
||||
String prenom = etPrenom.getText().toString();
|
||||
String mail = etMail.getText().toString();
|
||||
String numero = etNumero.getText().toString();
|
||||
String adresse = etAdresse.getText().toString();
|
||||
// On crée une instance de ClientDAO pour accéder à la base de données
|
||||
ClientDAO clientDAO = new ClientDAO(this);
|
||||
// On appelle la méthode updateClient avec toutes les nouvelles valeurs + l'ID du client
|
||||
clientDAO.updateClient(idClient, nom, prenom, mail, numero, adresse);
|
||||
// On ferme la connexion à la base de données pour libérer les ressources
|
||||
clientDAO.close();
|
||||
|
||||
Toast.makeText(this, "Client modifié", Toast.LENGTH_SHORT).show();
|
||||
// On ferme cette activité et on revient à l'écran précédent (ex : la liste des clients)
|
||||
finish(); // retour à la liste
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
109
app/src/main/java/com/example/dpanntout/creerIntervention.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
import bdd.ClientDAO;
|
||||
import bdd.InterventionDAO;
|
||||
import metier.Client;
|
||||
import metier.Intervention;
|
||||
|
||||
public class creerIntervention extends AppCompatActivity {
|
||||
private EditText observation;
|
||||
private EditText date ;
|
||||
private EditText idCliInter ;
|
||||
private Button ajtInter;
|
||||
|
||||
//variables qui vont recuperer les valeurs saisies
|
||||
String saisieObservation;
|
||||
String saisiedate;
|
||||
int saisieIdCli;
|
||||
|
||||
|
||||
Intervention intervention ; //nv client créer avec les nvl valeur
|
||||
long IdInnterventioncree; //id unique du client crée
|
||||
|
||||
private InterventionDAO interventionDAO = null;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_creer_intervention);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
Initialisation();
|
||||
CreationIntervention();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Initialisation() {
|
||||
//gestion du bouton quitter
|
||||
Button tvBtQuitterInter = (Button) findViewById(R.id.tvBtQuitterInter);
|
||||
//associer l'evenement quitter au boutton quitter
|
||||
tvBtQuitterInter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
interventionDAO.close();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//methode pour créer le nouveau client avec les informations saisies
|
||||
public void CreationIntervention(){
|
||||
// Reconnaissance des contrôles graphiques de la vue
|
||||
observation = (EditText) findViewById(R.id.tvDateInterP3);
|
||||
date = (EditText) findViewById((R.id.obsInterP3));
|
||||
idCliInter = (EditText) findViewById(R.id.idCliInter) ;
|
||||
ajtInter =(Button) findViewById(R.id.btAddInter);
|
||||
//acces à la table client
|
||||
interventionDAO = new InterventionDAO(this);
|
||||
// Gestion de l'événement onClick sur le boutn Ajouter
|
||||
ajtInter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//recuperation des zones de valeurs saisies
|
||||
saisieObservation = observation.getText().toString();
|
||||
saisiedate = date.getText().toString();
|
||||
saisieIdCli = Integer.parseInt(idCliInter.getText().toString());
|
||||
|
||||
intervention = new Intervention(saisieObservation, saisiedate,(int) saisieIdCli);
|
||||
|
||||
long IdInnterventioncree = interventionDAO.create(intervention);
|
||||
|
||||
//toast pour afficher un msg a l'ecran
|
||||
Toast.makeText(getApplicationContext(), "Intervention ajouté + " + "no : " + IdInnterventioncree + ")", Toast.LENGTH_SHORT).show();
|
||||
|
||||
//permettre au zone de saisie de s'effacer quand on a enregistrer
|
||||
observation.setText("");
|
||||
date.setText("");
|
||||
idCliInter.setText("");
|
||||
} });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
69
app/src/main/java/metier/Client.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package metier;
|
||||
|
||||
public class Client {
|
||||
|
||||
private int id = 0;
|
||||
private String nom;
|
||||
private String prenom;
|
||||
private String adrMail;
|
||||
private String numTel;
|
||||
private String adrPostale;
|
||||
|
||||
|
||||
public int getId() {
|
||||
|
||||
return id;
|
||||
}
|
||||
public String getNom() {
|
||||
|
||||
return nom;
|
||||
}
|
||||
public String getPrenom() {
|
||||
|
||||
return prenom;
|
||||
}
|
||||
public String getAdrMail() {
|
||||
return adrMail;
|
||||
}
|
||||
|
||||
public String getNumTel() {
|
||||
|
||||
return numTel;
|
||||
}
|
||||
|
||||
|
||||
public String getAdrPostale() {
|
||||
return adrPostale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Client{" +
|
||||
"id=" + id +
|
||||
", nom='" + nom + '\'' +
|
||||
", prenom='" + prenom + '\'' +
|
||||
", adrMail='" + adrMail + '\'' +
|
||||
", numTel='" + numTel + '\'' +
|
||||
", adrPostale='" + adrPostale + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
//constructeur avec id client qui sera utiles pour recuperer un client depuis la bdd
|
||||
public Client(int id, String nom, String prenom, String adrMail, String numTel, String adrPostale) {
|
||||
this.id = id;
|
||||
this.nom = nom;
|
||||
this.prenom = prenom;
|
||||
this.adrMail = adrMail;
|
||||
this.numTel = numTel;
|
||||
this.adrPostale = adrPostale;
|
||||
}
|
||||
|
||||
//constructeur sans idClient qui sera utile pour créer un nv client, son id sera generer dans la bdd
|
||||
public Client(String nom, String prenom, String adrMail,String numTel, String adrPostale) {
|
||||
this.nom = nom;
|
||||
this.prenom = prenom;
|
||||
this.adrMail = adrMail;
|
||||
this.numTel = numTel;
|
||||
this.adrPostale = adrPostale;
|
||||
}
|
||||
}
|
56
app/src/main/java/metier/Intervention.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package metier;
|
||||
|
||||
public class Intervention {
|
||||
private int id;
|
||||
private String dateTime;
|
||||
private String observation;
|
||||
private int idCli;
|
||||
|
||||
public Intervention(String dateTime, String observation, int idCli) {
|
||||
this.dateTime = dateTime;
|
||||
this.observation = observation;
|
||||
this.idCli = idCli;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Intervention{" +
|
||||
"id=" + id +
|
||||
", dateTime='" + dateTime + '\'' +
|
||||
", observation='" + observation + '\'' +
|
||||
", idCli=" + idCli +
|
||||
'}';
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public void setDateTime(String dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
public String getObservation() {
|
||||
return observation;
|
||||
}
|
||||
|
||||
public void setObservation(String observation) {
|
||||
this.observation = observation;
|
||||
}
|
||||
|
||||
public int getIdCli() {
|
||||
return idCli;
|
||||
}
|
||||
|
||||
public void setIdCli(int idCli) {
|
||||
this.idCli = idCli;
|
||||
}
|
||||
}
|
170
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
30
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
BIN
app/src/main/res/drawable/logodepann.png
Normal file
After Width: | Height: | Size: 488 KiB |
93
app/src/main/res/layout/activity_creer_client.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".CreerClient">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="729dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitreApP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitreP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="@string/titreAddCli"
|
||||
android:textAlignment="center"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ptNomCliP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:inputType="text"
|
||||
android:text="@string/nomCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ptPreCliP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:ems="11"
|
||||
android:inputType="text"
|
||||
android:text="@string/prenomCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ptmelCliP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/adMelCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ptNumCliP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:ems="11"
|
||||
android:inputType="text"
|
||||
android:text="@string/numCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ptAdPoCliP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/adPoCli" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btAjtP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btAjtP1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/BtQuitP1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btQuitterP1" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
72
app/src/main/res/layout/activity_creer_intervention.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".creerIntervention">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="409dp"
|
||||
android:layout_height="729dp"
|
||||
android:orientation="vertical"
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
tools:layout_editor_absoluteY="1dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitreApP3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="@string/titreP3"
|
||||
android:textAlignment="center"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/tvDateInterP3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/dateIntervention" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/obsInterP3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/ObsInter" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/idCliInter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/idCliInter" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btAddInter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/BtAjtinter" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/tvBtQuitterInter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btQuitP3" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
106
app/src/main/res/layout/activity_liste_client.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ListeClient">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tvListeP2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="729dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvApNameP2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="@string/titrep2"
|
||||
android:textAlignment="center"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvnomP2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeNom" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPreP2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listePrenom" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMelP2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeMel" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNumP2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeNum" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdP2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeAd" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/lvCli"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"/>
|
||||
|
||||
<!-- <ListView-->
|
||||
<!-- android:id="@+id/lvCli"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_weight="1" />-->
|
||||
|
||||
<Button
|
||||
android:id="@+id/btModifP2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btPageModifierCli" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btQuitterP2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btQuiP2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
76
app/src/main/res/layout/activity_liste_intervention.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:context=".ListeIntervention">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="@string/titreP3"
|
||||
android:textAlignment="center"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDateP3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dateIntervention"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvObsP3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/ObsInter"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIdCliP3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/idCliInter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/lvInter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="544dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/tvBtQuitP3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="@string/btQuitP3" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
62
app/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="409dp"
|
||||
android:layout_height="729dp"
|
||||
android:orientation="vertical"
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
tools:layout_editor_absoluteY="1dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvApName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Display2"
|
||||
android:textColor="@color/design_default_color_primary_variant"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/LogoMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="288dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:srcCompat="@drawable/logodepann" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/tvBtMenuAdCli"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="@string/btMenuAdCli" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/tvBtMenuListCli"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="@string/btMenuListeCli" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/tvBtMenuAdInter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="@string/btMenuAjtInter" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/tvBtMenuListInter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:text="@string/btMenuListeInter" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
95
app/src/main/res/layout/activity_modifier_le_client.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ModifierLeClient">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="409dp"
|
||||
android:layout_height="729dp"
|
||||
android:orientation="vertical"
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
tools:layout_editor_absoluteY="1dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvApNameP5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="@string/modifCli"
|
||||
android:textAlignment="center"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/NomCliModif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/nomCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/preCliModif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/prenomCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/melCliModif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/adMelCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/numCliModif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/numCli" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/addModif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="@string/adPoCli" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btSaveModif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btEnrModif" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btQuitP5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btQuitModif" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btSupCli"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:soundEffectsEnabled="true"
|
||||
android:text="@string/SupprCliModif"
|
||||
android:textColor="@color/design_default_color_background"
|
||||
android:textColorLink="@color/design_default_color_background"
|
||||
android:textIsSelectable="false" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
58
app/src/main/res/layout/ligne_client.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="409dp"-->
|
||||
<!-- android:layout_height="729dp"-->
|
||||
<!-- android:orientation="horizontal" -->
|
||||
<!-- tools:layout_editor_absoluteX="1dp"-->
|
||||
<!-- tools:layout_editor_absoluteY="1dp">-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNomP2.2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeNom" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPrenomP2.2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listePrenom" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMelP2.2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeMel" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNumP2.2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeNum" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdP2.2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/listeAd" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
35
app/src/main/res/layout/ligne_intervention.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="409dp"
|
||||
android:layout_height="729dp"
|
||||
android:orientation="horizontal"
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
tools:layout_editor_absoluteY="1dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDateInter3.3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dateIntervention" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvobsInter3.3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/ObsInter" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIdCliInter3.3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/idCliInter" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 982 B |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 7.6 KiB |
7
app/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.DépannTout" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
5
app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
34
app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<resources>
|
||||
<string name="app_name">Dépann\'Tout</string>
|
||||
<string name="MenubtAjtClient">Ajouter un client</string>
|
||||
<string name="btMenuAdCli">Créer un client</string>
|
||||
<string name="btMenuListeCli">Liste des clients</string>
|
||||
<string name="btMenuAjtInter">Créer une intervention</string>
|
||||
<string name="btMenuListeInter">Liste des interventions</string>
|
||||
<string name="titreAddCli">Créer un nouveau client</string>
|
||||
<string name="prenomCli">Prénom du client</string>
|
||||
<string name="nomCli">Nom du client</string>
|
||||
<string name="numCli">Numéro du client</string>
|
||||
<string name="adPoCli">Adresse postale du client</string>
|
||||
<string name="adMelCli">Adresse mail du client</string>
|
||||
<string name="btQuitterP1">Quitter</string>
|
||||
<string name="btAjtP1">Ajouter le client</string>
|
||||
<string name="titrep2">Liste des clients</string>
|
||||
<string name="listePrenom">Prénom</string>
|
||||
<string name="listeNom">Nom</string>
|
||||
<string name="listeMel">Mail</string>
|
||||
<string name="listeNum">Numéro</string>
|
||||
<string name="listeAd">Adresse</string>
|
||||
<string name="btQuiP2">Quitter la liste</string>
|
||||
<string name="titreP3">Créer une nouvelle intervention</string>
|
||||
<string name="dateIntervention">date</string>
|
||||
<string name="ObsInter">Observation</string>
|
||||
<string name="btQuitP3">Quitter</string>
|
||||
<string name="BtAjtinter">Ajouter l\'intervention</string>
|
||||
<string name="idCliInter">NumClient</string>
|
||||
<string name="btPageModifierCli">Modifier un client</string>
|
||||
<string name="modifCli">Modifier un client</string>
|
||||
<string name="btQuitModif">Quitter l\'edition</string>
|
||||
<string name="btEnrModif">Enregistrer les modifications</string>
|
||||
<string name="SupprCliModif">Supprimer le client</string>
|
||||
</resources>
|
9
app/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.DépannTout" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.DépannTout" parent="Base.Theme.DépannTout" />
|
||||
</resources>
|
13
app/src/main/res/xml/backup_rules.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older than API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
19
app/src/main/res/xml/data_extraction_rules.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
17
app/src/test/java/com/example/dpanntout/ExampleUnitTest.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.example.dpanntout;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|