public TimeSpan GetSeniority() { if (IsActive) { return(DateTime.Now.Subtract(DateOfEmployment)); } else { return(DateOfDismissal.Subtract(DateOfEmployment)); } }
public override int GetHashCode() { unchecked { var hashCode = FiredEmployeeId; hashCode = (hashCode * 397) ^ EmployeeId; hashCode = (hashCode * 397) ^ DateOfDismissal.GetHashCode(); hashCode = (hashCode * 397) ^ (Reason != null ? Reason.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Deleted.GetHashCode(); return(hashCode); } }
public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } if (obj.GetType() != this.GetType()) { return(false); } FiredEmployee other = (FiredEmployee)obj; return(FiredEmployeeId == other.FiredEmployeeId && EmployeeId == other.EmployeeId && DateOfDismissal.Equals(other.DateOfDismissal) && string.Equals(Reason, other.Reason) && Deleted == other.Deleted); }
public override string GetDescription() => "<strong>Основание: </strong>" + Reason + "<br /><strong>Дата составления: </strong>" + DateOfPreparation?.ToShortDateString() + "<br /><strong>Дата увольнения: </strong>" + DateOfDismissal?.ToShortDateString();