Example #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetHashCode() != obj.GetHashCode())
            {
                return(false);
            }
            Persoana persoana = obj as Persoana;

            return(Nume.Equals(persoana.Nume) && Prenume.Equals(persoana.Prenume) &&
                   Email.Equals(persoana.Email) && Cetatenie.Equals(persoana.Cetatenie) &&
                   DataNastere.Equals(persoana.DataNastere) && NumarPasaport.Equals(persoana.NumarPasaport) &&
                   Telefon.Equals(persoana.Telefon) && CNP.Equals(persoana.CNP) &&
                   Sex.Equals(persoana.Sex));
        }
Example #2
0
        public override bool Equals(object obj)
        {
            var student = (Pacient)obj;

            if (student != null)
            {
                return(CNP.Equals(student.CNP));
            }
            return(false);
        }
Example #3
0
        public bool IsValid()
        {
            using (StreamReader sr = new StreamReader("user.txt"))
            {
                string line = string.Empty;
                while ((line = sr.ReadLine()) != null)
                {
                    var splitLine = line.Split(' ');

                    var cnp      = splitLine[0];
                    var password = splitLine[1];
                    if (CNP.Equals(cnp) && Password.Equals(password))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }