Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TP1
- {
- public class Liste_Commandes
- {
- public List<Commande> listeCde {get; set; }
- public Liste_Commandes()
- {
- listeCde = new List<Commande>();
- }
- public void ajouter_Cde(Commande c)
- {
- listeCde.Add(c);
- }
- public void supprimer_Cde(Commande c)
- {
- listeCde.Remove(c);
- }
- public int rechercher_cde(int numC)
- {
- int i = 0;
- bool test = false;
- while(test==false && i<listeCde.Count)
- {
- if (numC == listeCde[i].numero_com )
- {
- test = true;
- }
- else
- {
- i++;
- }
- }
- if (test == true)
- {
- return i;
- }
- else
- return -1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement