Esempio n. 1
0
        public override bool Equals(object other)
        {
            if (other is null || !(other is Employee))
            {
                return(false);
            }

            Employee emp = (Employee)other;

            if (!FirstName.Equals(emp.FirstName))
            {
                return(false);
            }

            if (!(LastName.Equals(emp.LastName)))
            {
                return(false);
            }

            if (!(AnnualIncome.Equals(emp.AnnualIncome)))
            {
                return(false);
            }

            if (!(SuperRate.Equals(emp.SuperRate)))
            {
                return(false);
            }

            if (this.Payslips.Except(emp.Payslips).Count() > 0 || emp.Payslips.Except(this.Payslips).Count() > 0)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
 public override string ToString()
 {
     return(FirstName + "," + LastName + "," + AnnualSalary.ToString("0.#") + "," + SuperRate.ToString("0.#") + "%," + PaymentPeriod);
 }