bouchnina

Class Manager

Jul 12th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. //sous-classe c est une classe qui herite de l autre
  2. Class Manager:Employe{
  3.  
  4. // list des employee
  5. List<Employe> LE = new List<Employe>();
  6. public Manager(){}
  7. public Manager(int numMatr,string nom,string prenom,DateTime DateEmb,decimal solde,List<Employe> LE)
  8. :base(numMatr,nom,prenom,DateEmb,solde)
  9. {
  10.     this.LE=LE;
  11. }
  12.  
  13. public override string ToString(){
  14.     string info="";
  15.     for(byte i=0;i<LE.Count;i++)
  16.         info+=("\t"+LE[i].ToString()+"\n");
  17. return base.ToString()+info;
  18. }
  19.  
  20. public void ListeEmployes(){
  21.     for(byte i=0;i<LE.Count;i++)
  22.         Console.WriteLine(LE[i].ToString());
  23. }
  24.  
  25. public void AjouterEmploye(Employe E){
  26.     LE.Add(E);
  27. }
  28.  
  29. public Employe GetEmployeByCode(int numMat){
  30.     for(byte i=0;i<LE.Count;i++)
  31.         if(LE[i].NumMat==numMat)
  32.             return LE[i];
  33. return null;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment