예제 #1
0
 private void LBX_Pigeon_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (LBX_Pigeon.Text.Length != 0)
     {
         Pigeon pigeon = (Pigeon)LBX_Pigeon.SelectedItem; SelectLBL_Pigeon(pigeon);
     }
 }
예제 #2
0
 private void SelectLBL_Pigeon(Pigeon pigeon)
 {
     if (pigeon.IDPerePigeon == 0 && pigeon.IDMerePigeon == 0)
     {
         TBX_IDPigeonneau.Text = pigeon.ID_Oiseau.ToString(); TBX_NomPigeonneau.Text = pigeon.Nom_Oiseau;
     }
     if (pigeon.Sexe_Pigeon == "Mâle")
     {
         TBX_IDPerePigeon.Text = pigeon.ID_Oiseau.ToString(); TBX_NomPerePigeon.Text = pigeon.Nom_Oiseau;
     }
     else if (pigeon.Sexe_Pigeon == "Femelle")
     {
         TBX_IDMerePigeon.Text = pigeon.ID_Oiseau.ToString(); TBX_NomMerePigeon.Text = pigeon.Nom_Oiseau;
     }
 }
예제 #3
0
 private void TLS_ModifierAnimaux_Click(object sender, EventArgs e)
 {
     if (CBX_TypeAnimal.Text == "Chat")
     {
         Chat chat = (Chat)LBX_Chat.SelectedItem; ModifLBL_Chat(chat); UpdateLBL_Chat(chat);
     }
     else if (CBX_TypeAnimal.Text == "Chien")
     {
         Chien chien = (Chien)LBX_Chien.SelectedItem; ModifLBL_Chien(chien); UpdateLBL_Chien(chien);
     }
     else if (CBX_TypeAnimal.Text == "Pigeon")
     {
         Pigeon pigeon = (Pigeon)LBX_Pigeon.SelectedItem; ModifLBL_Pigeon(pigeon); UpdateLBL_Pigeon(pigeon);
     }
 }
예제 #4
0
 //Commande animaux
 private void TSB_Add_Click(object sender, EventArgs e)
 {
     if (CBX_TypeAnimal.Text == "Chat")
     {
         Chat chat = new Chat(int.Parse(TBX_IDAnimal.Text), TBX_NomAnimal.Text, int.Parse(TBX_AgeAnimal.Text), CBX_SexeAnimal.Text, TBX_Race.Text, 0, "Aucun nom", 0, "Aucun nom");
         RemplirLB_Chat(chat);
     }
     else if (CBX_TypeAnimal.Text == "Chien")
     {
         Chien chien = new Chien(int.Parse(TBX_IDAnimal.Text), TBX_NomAnimal.Text, int.Parse(TBX_AgeAnimal.Text), CBX_SexeAnimal.Text, TBX_Race.Text, 0, "aucun nom", 0, "aucun nom");
         RemplirLB_Chien(chien);
     }
     else if (CBX_TypeAnimal.Text == "Pigeon")
     {
         Pigeon pigeon = new Pigeon(int.Parse(TBX_IDAnimal.Text), TBX_NomAnimal.Text, int.Parse(TBX_AgeAnimal.Text), CBX_SexeAnimal.Text, TBX_Race.Text, 0, "Aucun nom", 0, "Aucun nom");
         RemplirLB_Pigeon(pigeon);
     }
 }
예제 #5
0
 private void ModifLBL_Pigeon(Pigeon pigeon)
 {
     pigeon.Nom_Oiseau = TBX_NomPigeonneau.Text; pigeon.IDPerePigeon = Convert.ToInt32(TBX_IDPerePigeon.Text); pigeon.NomPerePigeon = TBX_NomPerePigeon.Text; pigeon.IDMerePigeon = Convert.ToInt32(TBX_IDMerePigeon.Text); pigeon.NomMerePigeon = TBX_NomMerePigeon.Text;
 }
예제 #6
0
 private void B_AddPigeon_Click(object sender, EventArgs e)
 {
     Pigeon pigeon = (Pigeon)LBX_Pigeon.SelectedItem;  ModifLBL_Pigeon(pigeon); UpdateLBL_Pigeon(pigeon);
 }
예제 #7
0
 private void UpdateLBL_Pigeon(Pigeon pigeon)
 {
     LBX_Pigeon.Items.Add(pigeon); LBX_Pigeon.Items.Remove(LBX_Pigeon.SelectedItem);
 }
예제 #8
0
 private void ModifLBL_Pigeon(Pigeon pigeon)
 {
     pigeon.Nom_Oiseau = TBX_NomAnimal.Text; pigeon.Age_Oiseau = Convert.ToInt32(TBX_AgeAnimal.Text); pigeon.Sexe_Pigeon = CBX_SexeAnimal.Text; pigeon.Type_Pigeon = TBX_Race.Text;
 }
예제 #9
0
 private void RemplirLBL_Pigeon(Pigeon pigeon)
 {
     CBX_TypeAnimal.Text = "Pigeon"; TBX_IDAnimal.Text = pigeon.ID_Oiseau.ToString(); TBX_NomAnimal.Text = pigeon.Nom_Oiseau.ToString(); TBX_AgeAnimal.Text = pigeon.Age_Oiseau.ToString(); CBX_SexeAnimal.Text = pigeon.Sexe_Pigeon.ToString(); TBX_Race.Text = pigeon.Type_Pigeon.ToString();
 }
예제 #10
0
 private void RemplirLB_Pigeon(Pigeon pigeon)
 {
     LBX_Pigeon.Items.Add(pigeon);
 }