Ejemplo n.º 1
0
        public Race Ajouter(string race_, string espece)
        {
            Race race = new Race(race_,espece);
            Database.Instance.insert(race);

            return race;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// creer via le store un object animal et l'ajoute dans la bindinglist
 /// </summary>
 /// <param name="nomAnimal"></param>
 /// <param name="sexe"></param>
 /// <param name="antecedant"></param>
 /// <param name="archive"></param>
 /// <param name="client"></param>
 /// <param name="couleur"></param>
 /// <param name="race"></param>
 /// <param name="tatouage"></param>
 /// <returns>un object animal</returns>
 /// <exception cref="Exception"></exception>
 public Animal AjouterAnimal(string nomAnimal, Animal.eSexe sexe, string couleur, Race race,
      string tatouage, string antecedant, bool archive, Client client)
 {
     try
     {
         Animal a = AnimalStore.Instance.Ajouter(nomAnimal, sexe, couleur, race, tatouage, antecedant, archive, client);
         _animaux.Add(a);
         return a;
     }
     catch (Exception e)
     {
         throw e;
     }
     return null;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creer un animal
 /// </summary>
 /// <param name="nomAnimal"></param>
 /// <param name="sexe"></param>
 /// <param name="couleur"></param>
 /// <param name="race"></param>
 /// <param name="tatouage"></param>
 /// <param name="antecedant"></param>
 /// <param name="archive"></param>
 /// <param name="client"></param>
 /// <returns></returns>
 /// <exception cref="Exception"></exception>
 public Animal Ajouter(string nomAnimal, Animal.eSexe sexe, string couleur, Race race,
      string tatouage, string antecedant, bool archive, Client client)
 {
     Animal animal = new Animal(Guid.NewGuid(), nomAnimal, sexe, couleur, race, tatouage, antecedant, archive, client);
     try
     {
         Database.Instance.insert(animal);
         this.Animaux.Add(animal);
     }
     catch (Exception e)
     {
         throw new Exception("Erreur sur Ajout.\n" + e.Message, e);
     }
     return animal;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Construteur Animal
 /// </summary>
 /// <param name="codeAnimal"></param>
 /// <param name="nomAnimal"></param>
 /// <param name="sexe"></param>
 /// <param name="couleur"></param>
 /// <param name="race"></param>
 /// <param name="tatouage"></param>
 /// <param name="antecedents"></param>
 /// <param name="archive"></param>
 /// <param name="client"></param>
 /// <exception cref="Exception"></exception>
 public Animal(Guid codeAnimal, string nomAnimal, eSexe sexe, string couleur, Race race,
      string tatouage, string antecedents, Boolean archive, Client client)
 {
     try
     {
         CodeAnimal = codeAnimal;
         NomAnimal = nomAnimal;
         Sexe = sexe;
         Couleur = couleur;
         Race = race;
         Tatouage = tatouage;
         Antecedents = antecedents;
         Archive = archive;
         Client = client;
     }
     catch (Exception e)
     {
         throw new Exception("Cet animal ne peut être cree avec ces valeurs\n" + e.Message, e);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Modifier animal
 /// </summary>
 /// <param name="animal"></param>
 /// <param name="nomAnimal"></param>
 /// <param name="sexe"></param>
 /// <param name="couleur"></param>
 /// <param name="race"></param>
 /// <param name="tatouage"></param>
 /// <param name="antecedents"></param>
 /// <param name="client"></param>
 /// <param name="archive"></param>
 /// <exception cref="Exception"></exception>
 public void ModifierAnimal(Animal animal, string nomAnimal, Animal.eSexe sexe, string couleur, Race race,
      string tatouage, string antecedents, Client client, bool archive = false)
 {
     try
     {
         AnimalStore.Instance.Modifier(animal, nomAnimal, sexe, couleur, race, tatouage, antecedents, archive, client);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 6
0
 public bool Supprimer(Race race)
 {
     return Database.Instance.delete(race);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Modifie l'animal
 /// </summary>
 /// <param name="animal"></param>
 /// <param name="nomAnimal"></param>
 /// <param name="sexe"></param>
 /// <param name="couleur"></param>
 /// <param name="race"></param>
 /// <param name="tatouage"></param>
 /// <param name="antecedents"></param>
 /// <param name="archive"></param>
 /// <param name="client"></param>
 /// <exception cref="Exception"></exception>
 public void Modifier(Animal animal, string nomAnimal, Animal.eSexe sexe, string couleur, Race race,
      string tatouage, string antecedents, bool archive, Client client)
 {
     animal.Antecedents = antecedents;
     animal.Archive = archive;
     animal.Client = client;
     animal.Couleur = couleur;
     animal.NomAnimal = nomAnimal;
     animal.Sexe = sexe;
     animal.Tatouage = tatouage;
     animal.Race = race;
     try
     {
         Database.Instance.update(animal);
     }
     catch (Exception e)
     {
         throw new Exception("Erreur sur Modification.\n" + e.Message,e);
     }
 }
Ejemplo n.º 8
0
 public bool SupprimerRace(Race race)
 {
     return RaceStore.Instance.Supprimer(race);
 }