Statistiques
| Branche: | Révision:

rfid-cb / CodeBarreRFID / Model / Animal.cs @ 0f2b4298

Historique | Voir | Annoter | Télécharger (825 octets)

1 0f2b4298 ajournaux
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
7
namespace CodeBarreRFID.Model
8
{
9
    public class Animal
10
    {
11
        public String RFID { get; set; }
12
        public String CodeBarre { get; set; }
13
14
        public Animal() { }
15
16
        public Animal(string csv)
17
        {
18
            string[] values = csv.Split(';');
19
            RFID = values[0];
20
            CodeBarre = values[1];
21
        }
22
23
        public override bool Equals(object obj)
24
        {
25
            Animal animal = obj as Animal;
26
            if (animal == null) return false;
27
            return this.RFID.Equals(animal.RFID);
28
        }
29
30
        public override int GetHashCode()
31
        { 
32
            return this.RFID.GetHashCode();
33
        }
34
35
    }
36
}