rfid-cb / CodeBarreRFID / DAO / VivantDAO.cs @ 0f2b4298
Historique | Voir | Annoter | Télécharger (996 octets)
1 |
using CodeBarreRFID.Model; |
---|---|
2 |
using CommunityToolkit.Maui.Alerts; |
3 |
using CommunityToolkit.Maui.Core; |
4 |
|
5 |
namespace CodeBarreRFID.DAO |
6 |
{ |
7 |
public static class VivantDAO |
8 |
{ |
9 |
public static List<Vivant> GetVivants() |
10 |
{ |
11 |
List<Vivant> vivants = new List<Vivant>(); |
12 |
Vivant v1 = new Vivant(1, "INRAE01"); |
13 |
Vivant v2 = new Vivant(2, "INRAE02"); |
14 |
Vivant v3 = new Vivant(3, "INRAE03"); |
15 |
vivants.Add(v1); |
16 |
vivants.Add(v2); |
17 |
vivants.Add(v3); |
18 |
return vivants; |
19 |
} |
20 |
|
21 |
public static Vivant GetVivantById(int id) |
22 |
{ |
23 |
Vivant vivant = GetVivants().FirstOrDefault(x => x.VivantId == id); |
24 |
return vivant; |
25 |
} |
26 |
|
27 |
public static async Task Save(Vivant vivant) |
28 |
{ |
29 |
await Task.Delay(1000); |
30 |
IToast t = Toast.Make("Enregistrement OK !", ToastDuration.Long); |
31 |
await t.Show(); |
32 |
} |
33 |
} |
34 |
} |